Good morning,
I'd like to ask something about operator controlled and system controlled. I try to use operator controlled in my research before but i ended up to many "force-entry" using left click mouse, so i try to switch to system-controlled for more reliable data entry. But i found that my code in operator-controlled can not be run in system-controlled.
I attach both operator-controlled and system-controlled for more clearer understanding. Both have exact same dictionary, code, and form. But operator-controlled work smoothly while system-controlled fail at the system-check section at the end.
I wish someone can enlighten me regarding this problem. Is there any additional code to make my code in system-controlled work just like operator-controlled one?
Thank you,
Ces.
Operator Controlled vs System Controlled.
Operator Controlled vs System Controlled.
- Attachments
-
- CSPRO SYSTEMCONTROLLED ERROR.rar
- (10.63 KiB) Downloaded 258 times
-
- CSPRO OPERATORCONTROLLED WORK.rar
- (10.61 KiB) Downloaded 246 times
-
- Posts: 1792
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Operator Controlled vs System Controlled.
A big difference between the modes if how skips are handled.
In system-controlled mode, any fields that are skipped over will have a value of notappl. What's happening in your checks, in system-controlled mode, is that in this section many of the CEK... values have been skipped over, so their value is notappl. Your conditional checks will fail when using notappl values.
1) Use the visualvalue function to get the actual value on the form, even if it was skipped over.
2) Treat notappl values as 0. If you execute this code before your checks, then you will get your expected behavior:
In system-controlled mode, any fields that are skipped over will have a value of notappl. What's happening in your checks, in system-controlled mode, is that in this section many of the CEK... values have been skipped over, so their value is notappl. Your conditional checks will fail when using notappl values.
IF (AP3A + AP3B + AP3C + AP3D) - (AP4A + AP4B + AP4C + AP4D) - (AP5A + AP5B + AP5C + AP5D) = (CEK16a + CEK16b + CEK16c + CEK16d + CEK16e + CEK16f + CEK16g + CEK16h + CEK16I + CEK16J) THEN
CEK16 = 1;
endlevel;
ELSEIF (AP3A + AP3B + AP3C + AP3D) - (AP4A + AP4B + AP4C + AP4D) - (AP5A + AP5B + AP5C + AP5D) <> (CEK16a + CEK16b + CEK16c + CEK16d + CEK16e + CEK16f + CEK16g + CEK16h + CEK16I + CEK16J) THEN
CEK16 = 0;
errmsg("WRONG!");
reenter start_check;
ELSE CEK16 = 1;
endlevel;
ENDIF;
You can do two things:CEK16 = 1;
endlevel;
ELSEIF (AP3A + AP3B + AP3C + AP3D) - (AP4A + AP4B + AP4C + AP4D) - (AP5A + AP5B + AP5C + AP5D) <> (CEK16a + CEK16b + CEK16c + CEK16d + CEK16e + CEK16f + CEK16g + CEK16h + CEK16I + CEK16J) THEN
CEK16 = 0;
errmsg("WRONG!");
reenter start_check;
ELSE CEK16 = 1;
endlevel;
ENDIF;
1) Use the visualvalue function to get the actual value on the form, even if it was skipped over.
2) Treat notappl values as 0. If you execute this code before your checks, then you will get your expected behavior:
setproperty("SpecialValuesZero","Yes");
If you are not using CSPro 7.1, you can do this instead:set behavior() specialvalues(zero) on;
Re: Operator Controlled vs System Controlled.
Thank you for enlightened me sir Gregory <(_ _)>