Page 1 of 1

How to automate systime()

Posted: July 5th, 2012, 11:10 pm
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.

Re: How to automate systime()

Posted: July 5th, 2012, 11:16 pm
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.

Re: How to automate systime()

Posted: July 8th, 2012, 5:59 pm
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());