Understanding constants

This is an introduction to constant definition.

A constant defines a read-only value identified by a name. A constant is similar to a variable, except that its value cannot be modified by program code.

A constant is defined with an identifier, and optional data type and a literal value.

Constants are typically used to define common invariable values that will be used at several places in a program:
CONSTANT PI DECIMAL(12,10) = 3.1415926,
       MAX_SIZE INT = 10000,
       ERRMSG = "PROGRAM ERROR: %1" -- type defaults to STRING

A good practice is to group constants that belong to the same domain in a given .4gl module. Defining these constants as PUBLIC, and import the module where the constants are needed.