Page 1 of 1

Logic with Checkboxes

Posted: February 18th, 2014, 10:20 am
by Stavros
Hi all,

I have an item which is turned into alphanumerical in order to use it as check-box for multiple answers. The value set is ranged from A-V , where V is Other,Specify. I want to activate the next field which is the Specify field only if V is chosen in the check-box. I have not yet found the correct way to do it. For numerical fields (where V is 98) the code:
preproc
if Q405<>98 then noinput; endif;

works fine, but I cannot do the same for the check-box. I tried:
preproc
if Q405<>"V" then noinput; endif;

but it does not seem to do the trick. Any suggestions?

Thanks in advance Stavros

Re: Logic with Checkboxes

Posted: February 18th, 2014, 11:01 pm
by Gregory Martin
For alpha fields, you will have to use the pos or poschar functions. For example:
if pos("V",Q405) = 0 then // V was not found in the string
    noinput;
endif;

Re: Logic with Checkboxes

Posted: February 20th, 2014, 10:41 am
by Stavros
Thanks a lot!