I have variable in code that I need to check to verify if the process can
continue. I have two defined variables:
SET VAR vreq_category TEXT = 'S'
SET VAR vsms_access INTEGER = 30
Now, if vreq_category = 'S' AND vsms_access is less than 40 then an warning
message is generated.
If vreq_category is not equal to 'S" then no warning is issued.
If vrew_category = 'S' and vsms_access is eaula or greater than 40 then no
warning is issued.
The following code works correctly"
SET VAR vreq_category TEXT = 'S'
SET VAR vsms_access INTEGER = 30
IF vreq_category = 'S' THEN
IF vsms_access < 40 THEN
SET VAR vMsg = ('You need SMS access level 40 or higher' + CHAR(13) +
+ 'To create Sign work Order.' + CHAR(13) )
PAUSE 2 USING .vMsg CAPTION 'System Message...' +
ICON Warning +
BUTTON 'Press any key to continue...' +
OPTION THEMENAME &vUser_theme
GOTO Done
ENDIF
ENDIF
...
LABEL Done
Now, if I combine the IF statements, the warning code is bypassed:
SET VAR vreq_category TEXT = 'S'
SET VAR vsms_access INTEGER = 30
IF (vreq_category = 'S' AND vsms_access < 40) THEN
SET VAR vMsg = ('You need SMS access level 40 or higher' + CHAR(13) +
+ 'To create Sign work Order.' + CHAR(13) )
PAUSE 2 USING .vMsg CAPTION 'System Message...' +
ICON Warning +
BUTTON 'Press any key to continue...' +
OPTION THEMENAME &vUser_theme
GOTO Done
ENDIF
...
LABEL Done
If I change the "AND" to "OR" the code is executed, but I need it to
evaluate both conditions at the same time and not one or the other.
I don't know if I am too sleepy and can't see the obvious but I would think
that both snippets of code should work...I am probably overlooking something
obvious.
TIA.
Javier,
Javier Valencia, PE
O: 913-829-0888
H: 913-397-9605
C: 913-915-3137
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================