Initialize a named data structure to its default values

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
INIT data_structure [, ...]



A named record, group, structfield, or individual field. (a)


The INIT statement initializes a named data structure to its declared default values, if provided, or to the defaults for the specified types. When an array is initialized, all elements in the array are initialized.

In general, if INIT is used on an argument, an error will be generated. The only exception to this is non‑arrayed structfield arguments that do not contain objects.


The INIT statement below initializes field1 to NULL, field2 to 28, field3 to “Initial value”, and field4 to 0.

record myrecord
    field1      ,i4
    field2      ,d3     ,28
    field3      ,a20    ,"Initial value"
    field4      ,d8.2
    init myrecord