Logic conditional on a value in a roster's occurrence

Discussions about CSEntry
Post Reply
giacomoz
Posts: 8
Joined: August 7th, 2013, 4:32 am

Logic conditional on a value in a roster's occurrence

Post 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
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

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

Post by Gregory Martin »

Giacomo,

You would write your code like this:
PROC ORANGES

preproc

    
if APPLES(4) = 5 then
        
skip to BANANAS;
    
endif;
giacomoz
Posts: 8
Joined: August 7th, 2013, 4:32 am

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

Post 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
Post Reply