How to automate systime()

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
tatadano
Posts: 18
Joined: July 5th, 2012, 11:00 pm

How to automate systime()

Post by tatadano »

Hi Guys, I'm back working with CSPro and a little bit rusty on some things. In a certain field like "time started encoding (protected)" I want to automate the process that it will input the system time to identity what time our encoder started his work. And I think if this will work same thing will apply to "time ended encoding".

Here's my code but its not working:

PROC TIME_STARTED_ENCODINH
PreProc
TIME_START=("99:99:99",systime());
HOUR = int(TIME_START / 10000);
MINUTES = int(TIME_START / 100) % 100;
SECONDS = TIME_START % 100;

And the error message: ERROR: Expecting right parenthesis ')' near line 2 in TIME_STARTED_ENCODINH procedure

And if I try to use this code:

PROC TIME_STARTED_ENCODINH
PostProc
TIME_START=systime();

The error I got: "Out of Range" then it implements clean up.

Your help is highly appreciated.
tatadano
Posts: 18
Joined: July 5th, 2012, 11:00 pm

Re: How to automate systime()

Post by tatadano »

tatadano wrote:Hi Guys, I'm back working with CSPro and a little bit rusty on some things. In a certain field like "time started encoding (protected)" I want to automate the process that it will input the system time to identity what time our encoder started his work. And I think if this will work same thing will apply to "time ended encoding".

Here's my code but its not working:

PROC TIME_STARTED_ENCODINH
PreProc
TIME_START=("99:99:99",systime());
HOUR = int(TIME_START / 10000);
MINUTES = int(TIME_START / 100) % 100;
SECONDS = TIME_START % 100;

And the error message: ERROR: Expecting right parenthesis ')' near line 2 in TIME_STARTED_ENCODINH procedure

And if I try to use this code:

PROC TIME_STARTED_ENCODINH
PostProc
TIME_START=systime();

The error I got: "Out of Range" then it implements clean up.

Your help is highly appreciated.
Whaaaa..got this one solved using this code:

PROC AUSAID_SURVEY_ID
PostProc
TIME_STARTED_ENCODINH=systime();

The code should be placed in the variable (AUSAID_SURVEY_ID) before the intended variable (TIME_STARTED_ENCODINH). It took me a while to figure it out. But anyways, THANKS.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: How to automate systime()

Post by Gregory Martin »

If TIME_START were an alpha variable, you could format it like it seemed you were doing in the code snippet that you posted, but you would need the edit function, like this:
TIME_START = edit("99:99:99",systime());
Post Reply