Page 1 of 1

skip statement

Posted: August 22nd, 2014, 2:11 am
by Rashmina
I am creating data entry application. I need to create skip statement. For that i had four cases and I created this statement:
"PROC TYPE_OF_TOILET
if TYPE_OF_TOILET = 6 then
skip to WHY_NO_LATRINE;
elseif TYPE_OF_TOILET = 1 or 2 or 3 then
skip to TIME_FOR_TOILET_TO_BE_FULL;
elseif TYPE_OF_TOILET = 4 or 5 or 0 then
skip to AVAILABILITY_OF_LIVESTOCKS;
endif ;"
it is not working. It only work upto second case. What can be done for this.

Re: skip statement

Posted: August 23rd, 2014, 7:44 pm
by pierre
Hello Rashmina,
If CSPro is giving you a compilation error on the second case, this is because the if statement is not properly structured.

Code: Select all

PROC TYPE_OF_TOILET
   if TYPE_OF_TOILET = 6 then
      skip to WHY_NO_LATRINE;
   elseif TYPE_OF_TOILET in 1,2,3 then     // use the <in> statement it acts like a combination of <or> statements.
      skip to TIME_FOR_TOILET_TO_BE_FULL;
   elseif TYPE_OF_TOILET in 4,5,0 then
      skip to AVAILABILITY_OF_LIVESTOCKS;
   endif ;

Re: skip statement

Posted: August 24th, 2014, 12:49 am
by Rashmina
Thank you. My problem had been solved.