Please enable JavaScript to view this site.

ESL Documentation

Definition

Define a constant.

[integer|float|boolean|string] constant CON1 is VALUE

[CON2 is VALUE] ...

CONn

The identifier for a constant name.

is VALUE

A compile-time value of the same type as the constant, representing the value of the constant.

Description

Use this statement to define a constant, which is a named entity that holds a data value that does not change during execution. Once you define a constant, you can reference it in the program. You can use a constant wherever a compile-time value is required.

When you define a constant, you define its type. The type that you specify for a constant determines the type of value required for the initialization. If you do not specify a type, it defaults to string.

If the program is compiled with External Strings, then the initial value of string constants will be externalized.

Example

float constant MAXIMUM_FC is 24.5

constant LIMIT_SC is "5000" # Limit and Trigger are string

TRIGGER_SC is "OK" # constants.