Hello,
I seek some help to improve the piece of code below.
It works but I would like to add that if "F" is found with any other letter, then generate an errmsg
I tried many variations but no success.
Thank you for any help
*********************************************
do varying i=1 until i>6
if Q132_DECLCONF[i:1] in "A", "B", "C", "D", "E" then //<------------If any found or any combination found, move to Q134
move to Q134_PROBPERSON;
elseif Q132_DECLCONF = "F" then //<------------If "F" alone, skip to Q135
skip to Q135_PROBPROFES;
endif;
enddo;
*********************************************
I would like to add //If "F" found with any other letter, error message
do varying (help)
-
- Posts: 1808
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: do varying (help)
I would write the code like this, without using a loop:
PROC Q132_DECLCONF
if Q132_DECLCONF = "F" then // F alone
skip to Q135_PROBPROFES;
elseif poschar("ABCDE",Q132_DECLCONF) and poschar("F",Q132_DECLCONF) then // F found with another letter
errmsg("You cannot enter F with another letter");
reenter;
else
skip to Q135_PROBPROFES;
endif;
if Q132_DECLCONF = "F" then // F alone
skip to Q135_PROBPROFES;
elseif poschar("ABCDE",Q132_DECLCONF) and poschar("F",Q132_DECLCONF) then // F found with another letter
errmsg("You cannot enter F with another letter");
reenter;
else
skip to Q135_PROBPROFES;
endif;
Re: do varying (help)
Fantastic.
Thank you very much for your help.
Thank you very much for your help.
Last bumped by Anonymous on July 2nd, 2012, 12:40 pm.