Warning

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

This is an old revision of the document!


CONST directive

Syntax:

const <varname> = <number>

The CONST directive 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. The number must be a numeric literal (no expression is allowed here).

Example:

const BORDER = $d020
const WHITE! = 1

poke BORDER, WHITE!

const PI% = 3.1415926