How to prevent time "hours" from being changed

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
lusia
Posts: 49
Joined: March 28th, 2018, 4:56 am

How to prevent time "hours" from being changed

Post by lusia »

Dear all,
I have a difficulty regarding systime() function using CSPRO 7.0.1
I want to make the "hours" item can't be changed even though, let's say, I moved back to the item before the "hours" item.
Even if I protect the item using the capture type in the item properties, it didn't worked.
Here is my script:

Code: Select all

PROC TIME_1
onfocus
	//fill in automatically 
	$ = systime("HH");
	noinput;
Kindly please help me.
Thank you before and after.

Regards,
lusia
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: How to prevent time "hours" from being changed

Post by Gregory Martin »

The noinput statement will allow an interviewer to move back into the field. If you never want to allow entry to the field, you should set it to protected.

You can then set it in logic:
PROC TIME_1

preproc

    // fill in automatically only if it is blank
    if visualvalue(TIME_1) = notappl then
        TIME_1 = systime("HH");
    endif;
lusia
Posts: 49
Joined: March 28th, 2018, 4:56 am

Re: How to prevent time "hours" from being changed

Post by lusia »

Sorry for the late reply.
I've implemented your script in my code. It worked perfectly.
Thank you very very very much.
:D :D :D

Regards,
lusia
Post Reply