How to capture system time in CSPro?

Discussions about CSEntry
Post Reply
Socio
Posts: 48
Joined: May 1st, 2017, 4:47 am

How to capture system time in CSPro?

Post by Socio »

How to capture system time in CSPro in HH:MM:SS format.
Thank you.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to capture system time in CSPro?

Post by josh »

You can use the systime() function. The help page for it has an example of getting in HH:MM:SS format.
Socio
Posts: 48
Joined: May 1st, 2017, 4:47 am

Re: How to capture system time in CSPro?

Post by Socio »

Hello Josh

Thanks for your reply.
I have tried
HI202 = systime();
HI202A= int(HI202A / 10000);
HI202B = int(HI202B / 100) % 100;
HI202C = HI202C % 100;

I don't know if I miss anything. Its not taking the system time automatically.
My question format and dictionary is like this.
Q HI202 : Time of interview.
I have given three subitems in dictionary for hh, mm & ss (which are given as HI202A, HI202B, HI202C).

Thank you.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to capture system time in CSPro?

Post by josh »

Here is an example: http://teleyah.com/cspro/DCJune2015/07- ... urvey7.zip

Look at PROC INTERVIEW_START_TIME_HOURS
sah
Posts: 97
Joined: May 28th, 2015, 3:16 pm

Re: How to capture system time in CSPro?

Post by sah »

Hello Socio,
You are absolutely missing something with this code with respect to your holding variable. it should reflect in the functions not the other way round.
HI202 = systime();
HI202A= int(HI202A / 10000);
HI202B = int(HI202B / 100) % 100;
HI202C = HI202C % 100;


It should be rather:
HI202 = systime();
HI202A= int(HI202/ 10000);
HI202B = int(HI202/ 100) % 100;
HI202C = HI202% 100;


Another way of writing it is

HI202A= int( systime()/ 10000);
HI202B = int( systime()/ 100) % 100;
HI202C = systime() % 100;


Hope this solve your problem.
Socio
Posts: 48
Joined: May 1st, 2017, 4:47 am

Re: How to capture system time in CSPro?

Post by Socio »

Hello Josh and Sah

I'm glad that I knew something today. Both example and logic are helpful.
One thing @Sah the time is not capture automatically. May be problem in my system.
Thank you both once again.
Post Reply