How to prevent time "hours" from being changed

Discussions about CSEntry
lusia
Posts: 18
Joined: March 28th, 2018, 4:56 am

How to prevent time "hours" from being changed

Postby lusia » March 28th, 2018, 5:16 am

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: 979
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

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

Postby Gregory Martin » March 28th, 2018, 7:49 am

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: 18
Joined: March 28th, 2018, 4:56 am

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

Postby lusia » March 28th, 2018, 9:04 pm

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


Return to “Entry”