NINIT
10.2
The NINIT instruction defines a UTF-8 character string variable and assigns it an initial value. The NINIT creates an NCHAR data construct which can only be initialized with valid UTF-8 encoded characters. It uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Data Definition Label.
init-data
Required. A valid UTF-8 character or UTF-8 control string literal containing variable initialization data.
%
Optional. Denotes the item as being GLOBAL.
%%
Optional. Denotes the item as GLOBAL but does not initialize it in any way.
*
Optional. Denotes the item or file as being COMMON.
^
Optional. Denotes the item as being a POINTER.
variable
Required. The name of a previously defined variable of the same type.
Flags Affected: NONE
Note the following:
The NINIT data variable is constructed the same as an NCHAR variable. The physical data size is four times the number of valid UTF-8 characters that exist in the string literal data that is stored into the data variable.
UTF-8 character string literals must be enclosed in quotation marks.
Ctrl string literals must be valid representations of binary, decimal, hex or octal values. The controll characters must have a value from 0 to 127 to be a valid UTF-8 character represented by a single byte value.
The Form Pointer is equal to the first character in the string.
The Physical Length is the largest number of valid UTF-8 characters stored into the variable. The Length Pointer is set to the last UTF-8 encoded character stored into the NINIT variable.
Arrays may not be defined using the NINIT instruction. To initialize an array, use the NCHAR instruction.
The ^ denotes a Pointer Variable.
If the % form is used, the data item is placed in the Global Data Area. The variable is then available to other programs that also declared it with the percent form. Global Data Items are available with PLBCMP only.
If the %% form is used, the data label is placed in the Global Data Area but no initialization takes place if it has not already been defined in the Global Data Area. If an array data label is placed in the Global Data Area, when initialized, it must have the same number of elements in the array. Global Data Items are available with PLBCMP only.
If the * form is used, the data item is in common with other programs and all of the rules of COMMON must be followed.
See Also: Example Code, NCHAR, Character String, Data Definitions
![]() |