
CONST symbolname = value
CONST arrayname =
{ value [, valuelist] }
valuelist = value [, value] ' up to 60 values per line
value = integernumber | floatingpointnumber
CONST bytearrayname AS BYTE = { value [, valuelist] }
CONST stringname = "any string"
The first line above declares a
compiler-time constant
More complex CONST can include strings, list of integers, floating point values or bytes
You can also the pre-processor #define -- see pre-processor
under the hood-
Single constants do not take up any program space as they are maintained by the ARMbasic Compiler.
Constants can be 32 bit values using the PC ARMbasic compiler and can be integer or floating point numbers. but constants are limited to 16bit values for the on chip ARMweb compiler. A floating point number is any number that contains a decimal point, without a decimal point numbers are assumed to be integers. If you want the floating point representation of an integer an example would be 123. , -455. , 0. , 122.0 or 0.0 .
Array constants can be 8 or 32 bit values and are stored in high memory along with constant strings and do take up Flash space available on the ARM. You can use the constants in your program as if it were an array.
Constant arrays can span more than one line, the compiler will keep reading lines until the final } is found. This feature was added in version 8.16c of the compiler.
Constants when used are not type checked or type converted, so if you try to assign an integer constant to a single variable, you will get odd looking results.