Multiple ANDs executed one by one from left to right?
Posted: Wed Jun 11, 2025 2:56 pm
At least currently, this code works:
But will this also work in the future? As in, if using multiple AND conditions, is it always so that they will be executed one by one, from left to right, ignoring the rest if one of them is not true.
As in this case, if it started checking if Mytable.test = 1, it would fail, since it couldn't access Mytable.Test, since it doesn't exist. However, in this case, the previous test is to check if Mytable has item "test" in it, and as that fails, then it doesn't check the other one either.
Is this the default way Hollywood is supposed to work, as in, this is how it will work in future versions too?
Code: Select all
mytable = {}
If HasItem(mytable, "test") = True And Mytable.test = 1
DebugPrint("do the stuff")
Else
DebugPrint("dont do the stuff")
endif
As in this case, if it started checking if Mytable.test = 1, it would fail, since it couldn't access Mytable.Test, since it doesn't exist. However, in this case, the previous test is to check if Mytable has item "test" in it, and as that fails, then it doesn't check the other one either.
Is this the default way Hollywood is supposed to work, as in, this is how it will work in future versions too?