How to use "or" in an if statement?

if [variable] == [stringA] or [stringB]

The reason you don’t see an error with this is because you aren’t comparing [stringB] with [variable].
[stringB] is compared to ""(empty string) and if it isn’t "" (empty string) the condition will return true.
The comparison you had set up is the equivalent of:
if [variable] == [stringA] or [stringB] != "":

if (conditionA) (logical operator) (conditionB)
The conditions in an if statement are independent of one another.
conditionB has nothing to do with conditionA

3 Likes