5. Variable Names and Expression Priority

Variable names may be of any length and can contain any of the upper- and lower-case letters, digits, underline and pound sign. They must begin with a letter but cannot begin with a keyword, since keywords are recognised before anything else, for example, both DEG and ASN in DEGASN are recognised, but neither is recognised in ADEGASN, which is therefore interpreted as a variable name. Integer variables end with % and string variables end with $. Names may begin with pseudo-variables (P1, LOMEM, HIMEM, TRUE, FALSE, PAGE), but note that P1%, PI$ etc. are still not allowed.

The various expression components have the following decreasing order of priority:

1 variables, functions () ? &, unary + - NOT
2
3
* / MOD DIV
4 + -
5 = <> <= >= > <
6 AND
7 EOR OR

Next Chapter