Must be preceded by if () `` loop, however it checks the condition at the end of the loop. If the value (the condition) between the parentheses is true, then run the statements between the braces. If the value given is no longer the same value from when this changed() was last called, return 1. Works on non-input values, but is functionally different. You can read more about triggering on the Expression 2 Core Timer pageĪlternative to ~, $. Returns 1 if the expression was triggered by the given input. If you use it on an output, it returns the number of wires to the output. If you use it on an input, it returns 1 if the input is wired to something. Note: Acceleration = $Velocity only when intervals are one second apart.Ĭan also be used to check if a variable has changed. Must precede a persistent variable, either from or Returns the current value of the variable minus the value of the variable at the end of the last execution. If A is true, then return B, otherwise return C. Tables and arrays still cannot be compared. Returns 1 when the two values being compared are not exactly equal to one another. Tables and arrays cannot be compared equal. Returns 1 when the two values being compared are exactly equal to one another. Sets a variable equal to another variable, the given literal, or a return.Įquivalency comparison. Otherwise, they are considered true.įunctions and methods which conceptually return "true" or "false" return 1 and 0 respectively.Īnything written after "#" on the same line will be treated as a comment (it will be ignored when the chip runs)Īnything between # brackets will be treated as a comment (it will be ignored when the chip runs)Īssignment operator. In Expression 2 conditionals, numbers are considered false if they equal 0. Remember there is not just one way to code something, you can accomplish the same task in several ways. The syntax in the Expression 2 will take some time to get used to, but will give you a lot of power over your expressions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |