Page 1 of 1

Logic conditional on a value in a roster's occurrence

Posted: August 7th, 2013, 4:48 am
by giacomoz
Dear CSPro users,

I am quite new to CSPro and I would like your help on this. I looked online but I could not find any reference.

I want to create a logic based on a specific value in a occurrence in a roster. Let me explain. I have a roster made of 6 occurrences in which a variable is called "APPLES". Few questions after the roster I have a variable called "ORANGES". I would like that if the fourth occurrence in "APPLES" is equal to 5, the variable "ORANGES" is skipped and next question is "BANANAS".

My unsuccessfully attempt is:

Code: Select all

PROC ORANGES
preproc
  if curocc(APPLES) = 4 then
	  skip to BANANAS
  endif;
Here I am only able to specify a non-empty occurrence (4) but not its value (5). Any suggestions?

Thank you very much,
Giacomo

Re: Logic conditional on a value in a roster's occurrence

Posted: August 7th, 2013, 10:31 am
by Gregory Martin
Giacomo,

You would write your code like this:
PROC ORANGES

preproc

    
if APPLES(4) = 5 then
        
skip to BANANAS;
    
endif;

Re: Logic conditional on a value in a roster's occurrence

Posted: August 7th, 2013, 11:14 am
by giacomoz
Dear Gregory,

Thank you so much for your prompt help - It is now clear to me where I was wrong.

Have a good day,
Giacomo