FutureBasic Logo

<<    Index    >> FutureBasic

Constant declaration   statement



Syntax
_constantName  = integer literal
_constantName$ = pascal string literal

Description
This is a non-executable statement which assigns the value of integer literal or pascal string literal to the symbolic constant indicated by _constantName or _constantName$. The _constantName should indicate a name which was not defined anywhere previously in the program, and which is different from all pre-defined FutureBasic symbolic constant names.

The value assigned to the constant must be either a "literal integer expression" or a "pascal string literal"; variables or function references cannot be assigned to a constant.
The constant's name must be preceded by an underscore '_' character and if the assigned value is a pascal string the constant name must be suffixed with the '$' character.

A constant name can be assigned a value only once. The override statement breaks this rule and should be used carefully by those familiar with its operation.

Examples

_myIntegerConstant = 246
_myPascalStringConstant$ = "useful string"

Another way to assign values to symbolic constant names is with the begin enum statement.

See also
override; begin enum; #define; Appendix C - Data Types and Data Representation