3 variables in *ifs

So. In variables, I know that you have to, when doing more then 1 condission, put in ()s
However, right now, I am trying to do 3 condissions. Would I need to do 4 condissions, I seem to remember the variables artical on the choice script wiki saying something about that, or would I just be able to do 3?

You can do more than 3 if you respect the ()

*if ((((q16 = 1) or (q12 = 1)) and (q4 = 0)) and (q19=1))
1 Like

It looks like you’re asking whether you have to use 4 variables. IF this is the case, no, you don’t. It would work, for example, to have the vollowing:

*create var1 5
*create var2 5
*create var3 5 
*Create var4 5 
*if (var2>=5) or (var3>=5) or (var4>=5) 
  Thing happens 

You could ignore var1 entirely.

You could also use or’s instead of ands in any combination.

1 Like

That would work with string, or Bullion variables as well?

Yes, I think maybe you meant “boolean”

Wanted to point out CS will see this as an error. CS can only recognize and resolves statements in pairs, so your bracketing should contain a pair.

*if ((var2>=5) or (var3>=5)) or (var4>=5) 
  Thing happens

Or to simplify:

*if ((TRUE) or (FALSE)) or (TRUE)
equals to
*if (TRUE) or (TRUE)