Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revisionBoth sides next revision
const [2019/05/04 21:50] – created neilsconst [2019/05/04 21:53] neils
Line 1: Line 1:
 ====== CONST statement ====== ====== CONST statement ======
  
-The ''CONST'' statement defines a constant. Syntax:+Syntax:
  
   const <varname> = <number>   const <varname> = <number>
   
-The constant can be subsequently used as a regular variable, except that it is read-only. The value may not be an expression.+The ''CONST'' statement defines a constant. The constant can be subsequently used as a regular variable, except that it is read-only.
  
-Constants of any types (bytes, integers or floats) may be defined.+Constants of any types (bytes, integers or floats) may be defined. The number must be a numeric literal (no expression is allowed here).
  
 Example: Example:
  
-  const BORDER = 53280+  const BORDER = $d020
   const WHITE! = 1   const WHITE! = 1