FORM Examples
Example 1:
|
|
|
|
PAGECNTR is a FORM numeric variable with a Physical Length (PL) of three bytes and a value of zero.
Example 2:
|
|
|
|
INVTOTAL is a FORM numeric variable with a Physical Length (PL) of eight bytes and a value of zero (interpreted as five positions before and two positions after the decimal).
Example 3:
|
|
|
|
TOTAL is a FORM numeric variable with a Physical length (PL) of nine bytes and a value of zero (interpreted as six positions before and two positions after the decimal). It is placed in the Global Data Area.
Example 4:
|
|
|
|
SALESTAX is a FORM numeric variable with a Physical Length (PL) of four bytes and a value of 1.05. This variable has an internal format of 1.2.
Example 5:
|
|
|
|
SALES is a FORM numeric array of 10 elements, each with a Physical Length (PL) of thirteen and a value of zero.
Example 6:
|
|
|
|
DISCOUNT is a FORM numeric array of 5 elements, each with a Physical Length (PL) of three bytes and a value of .05.
Example 7:
|
|
|
|
BIAS is a two-dimensional FORM numeric array with four elements (2,2) each having a Physical Length (PL) of four bytes and initialized as follows: BIAS(1,1) equals .05, BIAS(1,2) = 1.50, BIAS(2,1) = .75, and BIAS(2,2) = .10.
Example 8:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ARR1 is a numeric array with three elements. Each element of the array may be accessed using array subscripting or by its label.
Example 9:
|
|
|
|
|
|
|
|
|
|
|
|
FEQU is a FORM numeric variable with a Physical Length (PL) of nine and a value of '0', interpreted as having five positions to the left of the decimal point and three positions to the right of the decimal point.
Example 10:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PTRFORM is a Pointer Variable that contains the address of another FORM variable at execution time. This assignment is usually accomplished via the parameterized CALL instruction. Once initialized, PTRFORM may be used as any other FORM variable. It takes on all the attributes of the pointed to FORM variable.
Example 11:
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This example illustrates use of the SWDBC compatibility mode of the compiler (-zc=3).
![]() |