Negation operator?


#1

I’m probably being stupid but how do I do this?

*create x true
*if (NOT x)
  Do something

#2

You basically did it

*create x true
*if not (x)
  Something

Note: if (x) is true from the beginning, and you never change it (*set x false), then you’re never going to see the text in the *if block


#3

Thanks, you’re a life saver. I just can’t figure that out xD


#4
*if (x = false) works too

#5

You can check against a numeric or string variable as well, this doesn’t require a boolean (true-false) variable.

*if item_count != 30
    Your item count is something - anything - other than 30.
*if name != "Marie"
    Your name is not Marie.

#6

Also keep in mind that there is a strange bug with the *if not when using it inside choice options.


#7

Hmhm, just for funsies, let’s compile the possible combination.

*if not (X)
*if x = false
*if x != true