Good afternoon,
Hi my name is Cesa, and it's been a week since i learn cspro to do my thesis research.
I found some problem regarding multiple answer skip-pattern in cspro, and it would be great if anyone can help me.
I also attached cspro file about this case in hope that it would give a clearer picture.
There's 2 variable. var 1 and var1_other.
1. Var 1 is a string-type variable with 4 value option which can be answered by more than 1 value (multiple answer).
2. Var 1 other is a open answer with 30 long string that can only be entry if one of var 1 answer is "V" (v one of the value in var1).
The question is ;
1. Is there any skip-pattern / method to make var 1 (string-type) can not be answered by value that not stated in value option ?
for example : there's a,b,c and v. I want to make var 1 can't be filled with other than those value.
2. Is there any skip-pattern/method to make var1_other can only be filled if one of var1 answer is "v" ?.
Without "v" value in var1, var1_other can't be filled.
for example : var1 is filled with "acv", then var1_other can be fill. But if var1 is entered with "abc", then var1_other can not be fill.
Thank you,
Ces.
Multiple answer skip-pattern
Multiple answer skip-pattern
- Attachments
-
- cspro multiapleanswer.rar
- (1.54 KiB) Downloaded 320 times
Re: Multiple answer skip-pattern
Hi Ces,
For question 1, you can add a code like this:
For question 1, you can add a code like this:
Code: Select all
PROC VAR1
if VAR1[1:1] not in "a", "b", "c", "v", "", or
VAR1[2:1] not in "a", "b", "c", "v", "", or
VAR1[3:1] not in "a", "b", "c", "v", "", or
VAR1[4:1] not in "a", "b", "c", "v", "", or then errmsg("entry for var1 is invalid"); reenter VAR1;
endif;
For question 2, you can add a code like this:
[code]
PROC VAR1_OTHER
PREPROC
if not pos("V", VAR1) then skip to (var2); endif;
Re: Multiple answer skip-pattern
Thank you sir Saint,
It works perfectly.
Regards,
Ces.
It works perfectly.
Regards,
Ces.