Data initialization

If an EGL-generated program initializes a record automatically (as occurs in some cases, described later), each of the lowest-level structure items is set to a value appropriate to the primitive type. Form initialization is similar, except that your form declaration can assign values that override the defaults.

Initialization also occurs in these situations:

The next table gives details on the initialization values.

Primitive type Initialization value
BIN and the integer types (BIGINT, INT, and SMALLINT), HEX, FLOAT, SMALLFLOAT Binary zeros
CHAR, MBCHAR Single-byte blanks
DATE, TIME, TIMESTAMP Current value of the machine clock (for the number of bytes required by the mask, in the case of TIMESTAMP)
DBCHAR Double-byte blanks
DECIMAL, MONEY, NUM, NUMC, PACF Numeric zeros
INTERVAL Numeric zeros (for the number of bytes required by the mask), preceded by a plus sign
UNICODE Unicode blanks (each of which is hexadecimal 0020)

In a structure, only the lowest-level structure items are considered. If a structure item of type HEX is subordinate to a structure item of type CHAR, for example, the memory area is initialized with binary zeros.

Records or items that are received as program or function parameters are never initialized automatically.

An EGL-generated program initializes records, whether local or global.

Related concepts
Function part
DataItem part
Program part
Record parts
Structure

Related reference
EGL statements


Items
set