10-15-2023, 11:24 AM
Because BASIC never had a "boolean" type, and because so many programmers relied so much on "0 is false, non-zero is true", I have come across this situation with being able to write a condition, but needing to execute something when that condition is false, and not caring at all about when it's true. Something like this:
This is just an example but the condition could be a bit mind boggling. I simply do the "block if" and put "do nothing" comment on a line by itself. I do this programming in Lua as well. Even though in that scripting language, it's possible to assign a variable to "true" or "false" and the "if" statement responds to that.
Code: (Select All)
if x = 1 and y = 2 then
'do nothing
else
'a lot of code
end if
This is just an example but the condition could be a bit mind boggling. I simply do the "block if" and put "do nothing" comment on a line by itself. I do this programming in Lua as well. Even though in that scripting language, it's possible to assign a variable to "true" or "false" and the "if" statement responds to that.