Multiple Response
Posted: July 25th, 2022, 6:10 am
Dear CSPro Team,
I want to know about multiple option (Alpha) Question,
suppose I have few items like
Item1 A
Item2 B
Item1 C
Item2 D
and now I want to restrict entry of any code other than ABCD. Code must be in ABCD.
Now I am using this Code
string validalpha = "ABCD";
do numeric i = 1 while i <= length(strip(Q10000))
string char = Q10000[i:1];
if pos (char, validalpha) = 0 | (pos(char, Q10000[i+1])) then
errmsg("Invalid character '%s' or you are entering it twice. Only the following characters are allowed: %s", char, validalpha);
reenter;
endif;
enddo;
endif;
but I want to know that in place of ""string Validapha"" is there any other function which will automatically check the codes. There should not be need of defining codes like ABCD.
Thank you
I want to know about multiple option (Alpha) Question,
suppose I have few items like
Item1 A
Item2 B
Item1 C
Item2 D
and now I want to restrict entry of any code other than ABCD. Code must be in ABCD.
Now I am using this Code
string validalpha = "ABCD";
do numeric i = 1 while i <= length(strip(Q10000))
string char = Q10000[i:1];
if pos (char, validalpha) = 0 | (pos(char, Q10000[i+1])) then
errmsg("Invalid character '%s' or you are entering it twice. Only the following characters are allowed: %s", char, validalpha);
reenter;
endif;
enddo;
endif;
but I want to know that in place of ""string Validapha"" is there any other function which will automatically check the codes. There should not be need of defining codes like ABCD.
Thank you