CONST

Top  Previous  Next

Syntax

CONST name = value

Description

Defines a constant

Parameters

name - Name of constant

value - Integer value of constant, resolves to a UINT

Return value

None

Remarks

Constants work by direct substitution at compile time. Simple math is allowed to calculate the value and the calculations can contain the names of other constants. A constant cannot reference variables in your program as they are compiler calculated.

Operators allowed for constant calculations: +, -, /, *, &, |

See Also: SETID

Example usage

CONST BASE_VALUE = 0x4000
CONST SOMETHING = BASE_VALUE +1
CONST SOMETHING_ELSE = SOMETHING+1
a = SOMETHING
 
SELECT a
    CASE SOMETHING
        PRINT "It was something"
    CASE SOMETHING_ELSE
        PRINT "It was something else"
ENDSELECT