DIM Examples
Example 1:
|
|
|
|
TODAY is blank filled, has a Physical Length of 6, a Form Pointer of 0, and a Length Pointer of 0.
Example 2:
|
|
|
|
TODAY is blank filled, has a Physical Length of 6, a Form Pointer of 0, a Length Pointer of 0, and is placed in the Global Data Area.
Example 3:
|
|
|
|
TABLE1 is a character string array with 20 elements, TABLE1(1) through TABLE1(20)that are not initialized. Each array item is blank filled with a Physical Length of 15, a Form Pointer of 0, and a Length Pointer of 0.
Example 4:
|
|
|
|
TABLE2 is a two-dimensional array with 4 elements (2,2) each with a Physical Length of one and initialized as follows: TABLE2(1,1) equals A, TABLE2(1,2) equals B, TABLE2(2,1) equals C, and TABLE2(2,2) equals D.
Example 5:
|
|
|
|
|
(or) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
STATES is a character string array with 50 elements, STATES(1) through STATES(50)that have been initialized. The initialization data, inside the parentheses and quotes if a literal or parentheses only if a control code, is moved into the corresponding array item in the order given. If insufficient initialization contents are given for the array items specified, any remaining array items are treated as an uninitialized array item. Otherwise, each array item has a Physical Length of two, a Form Pointer set to one and a Length Pointer set to the last character of the initialized contents.
Example 6:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ARR1 is a character string array with 3 elements. Each element of the array may be accessed using array subscripting or by its label.
Example 7:
|
|
|
|
|
|
|
|
|
|
|
|
SVAR and NAME are both set equal to the length of SIZE.
Example 8:
|
|
|
|
BUFFER is blank filled, has a Physical Length of 32767, a Form Pointer of zero and an Length Pointer of zero.
Example 9:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PTRDIM is a Pointer Variable that contains the address of another DIM or INIT variable at execution time. This assignment is usually accomplished via the parameterized CALL instruction. Once initialized, PTRDIM may be used as any other DIM or INIT variable. It takes on all the attributes of the pointed to DIM or INIT variable.
Example 10:
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This example illustrates use of the SWDBC compatibility mode of the compiler (-zc=3).
![]() |