| script command: Condition |
What this does
| This command will optionally run the script inside of it if a variable equals a certain value. You can also use: | = (equal to) != (not equal to) < (less than) <= (less than or equal to) > (greater than) >= (greater than or equal to)
Comparison tricks
If you're creative, you can do a lot of things with condition commands. myVar != true This will run a script if myVar doesn't exist, if it's false, or if it equals anything other than the word "true" It encompasses much more than myVar = false. myVar != undefined This detects whether myVar exists. The script will run if it does exist. | if myNumber > 1, set it to 0. if myNumber = 0, do one thing. if myNumber = 1, do another. A series of condition commands like this will allow you to toggle a value between 0 and 1 just by adding 1 to it. This is useful for ON/OFF switches.
| Last updated: August 27, 2011 |