Is it possible... (making or/and statements with 3+ variables)

CS is always looking to evaluate two conditions. So you need to use brackets to group up your conditions into pairs. Additional brackets for when you use an equals sign as part of your comparator.

All of these work. There’s other combinations, but this should cover all the main stuff.

*create Condition_1 true
*create Condition_2 true
*create Condition_3 true
*create Condition_11 10
*create Condition_22 10
*create Condition_33 10

*if (Condition_1 or Condition_2) or Condition_3
    Yes
    

*if (Condition_1 and Condition_2) and Condition_3
    Yes


*if ((Condition_1 = true) or (Condition_2 = true)) or (Condition_3 = true)
    Yes


*if ((Condition_11 = 10) or (Condition_22 = 10)) or (Condition_33 = 10)
    Yes
6 Likes

You’re missing the close-parenthesis for your first open-parenthesis. Try
*if ((Delacruse >= 60) and (GenderValue = 1)) and (Religion = 2)

The thread above explains that you need to give ChoiceScript no more than two things to chew on at the same time. Anything inside parentheses is one thing. So what you had ended up with on your thread

*if (((Delacruse >= 60) and (GenderValue = 1)) and (Religion = 2))

is all “one thing.” I was pointing out that you don’t need to keep Religion in a bracket with the other two. But you do need to make sure you keep Delacruse and GenderValue in the same bracket.

Everyone should do what works for them, obvs. :slight_smile: But I find the more parentheses there are, the harder it gets to parse. Not putting in unnecessary parentheses helps me keep track of what’s going on, especially if there are ors as well as ands in play.

3 Likes