h2. Expressions Sub-expressions should be wrapped in brackets. eg. ("myfile/doc" RIGHT 4) LEFT 1 = "/" h3. System variable expansion h4. Prior to RISC OS 5.29, 10th February 2021 It was documented that any strings in the expression were passed to [[OS_GSTrans]], to expand system variable and decimal character codes. This would allow testing is a system variable is defined like: <code>"<Alias$@RunType_FFB>" = ""</code> However in reality the translation was done to the entire expression before parsing, which would likely result in the above expression being transformed to: <code>"Basic -quit "%0" %*1" = ""</code> which would result in an "Unknown operand" error. h4. After RISC OS 5.29, 10th February 2021 The system variable expansion was modified to a two pass scheme to prevent the value of the system variables expanded in strings being interpreted as expression syntax. # The unquoted parts of the expression are expanded. # The expression is parsed. # The literal strings are expanded. h3. Operations h4. Notes * Keywords must be UPPERCASE * n stands for an integer value * s stands for a string value * a stands for anything (integer or string) * A space is advised after the < and << operators to prevent confusion with system variable expansion, especially before RISC OS 5.21. h4. Arithmetic * n + n Integer addition * n - n Integer subtraction * n * n Integer multiplication * n / n Integer division * n MOD n Modulo division (i.e. remainder) h4. Boolean * n << n Logical shift left * n >> n Arithmetic shift right * n >>> n Logical shift right * n AND n And * n OR n Or * n EOR n Exclusive or * n NOT n Not h4. String * s + s Concatenation * s LEFT n Leftmost characters * s RIGHT n Rightmost characters * LEN s Number of characters h4. Comparison (-1 is TRUE, 0 is FALSE) * a = a Equal * a <> a Not equal * a < a Less than * a > a Greater than * a <= a Less than or equal * a >= a Greater than or equal h4. Conversion * STR n From integer to string * VAL s From string to integer h4. See also * [[*SetEval|*SetEval]]