Constants Description

Syntax

$ ConstantDeclaration = CONST ConstEntry { ConstEntry }

$ ConstEntry = ident "=" ConstExpression ";"

$ ConstExpression = Expression

Description

A description of a constant puts the constant value in accordance with the identifier.

A constant expression must be defined so that it could be calculated on the parsing stage. Either constants or the identifiers of previously defined constants can be used in the expression.

Example

Sub ConstSample;

Const

//Describe constants with different variants

// set their values

c1 = 1;

c2 = 'A';

c3 = "aHaHa";

c4 = 6.66;

c5 = 1 + 2 * 3 - 4;

c6 = 'A' + 'B' + 'C' + #48;

c7 = "aHaHa" + 'Z' + #48;

c8 = 6.66 / 2.22;

c9 = c1 + c4 * c8 - c5;

c10 = c2 + c3 + c6 + c7;

Begin

//Body of the program

End Sub ConstSample;

See also:

Descriptions and Syntax Rules