18,700
edits
m (→var: link fix) |
m (→if: wording) |
||
Line 136: | Line 136: | ||
if (7 - 8) # evaluates to true because it is non-zero | if (7 - 8) # evaluates to true because it is non-zero | ||
Be aware that BSL does not | Be aware that BSL does not always respect scope for blocks of code under "if" statements; some actions like setting variables and using "return" will occur even if the surrounding "if" condition is false (see [[#Flow interrupt|Flow interrupt]] for an example). A workaround for setting variables conditionally is to make the variable global, and under the "if" statement call a function that modifies that variable; function calls will not fire unless the "if" condition is true. | ||
The logical operators "and" and "or" can be used to string together multiple conditions: | The logical operators "and" and "or" can be used to string together multiple conditions: |