skip statement

Other discussions about CSPro
Post Reply
Rashmina
Posts: 2
Joined: August 7th, 2014, 12:40 am

skip statement

Post 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.
pierre

Re: skip statement

Post 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 ;
Rashmina
Posts: 2
Joined: August 7th, 2014, 12:40 am

Re: skip statement

Post by Rashmina »

Thank you. My problem had been solved.
Post Reply