Getting Started with TRANSACT (32247-90007)
98 Chapter6
Data Structures
In the Transact example, DEFINE(ITEM) (lines 1.1 to 1.23) defines the name, format, and
size of five data items. All five are of single word integer or binary format. In addition,
whenever storage space is reserved for enter, yes, or no, the space is initialized to contain
the values 0, 1, or 0, respectively. Note that DEFINE does not reserve space for the data
items. It more closely resembles the Pascal TYPE construct.
Lines 1.24 to 1.4 actually reserve space or make the data items known to Transact.
LIST(AUTO) in lines 2 and 3 also reserves space for data items. However, in this case the
data items have been previously defined in Dictionary/V. Also the VPLUS form names
vorderhead and vorderline have been defined in Dictionary/V. These lines are equivalent to
the following:
Figure 6-4. LIST(AUTO) Equivalent with LIST
Later on in the program there are verbs that input data from the VPLUS screens and
other verbs that update data in an IMAGE dataset. Examples from the program are:
Figure 6-5. VPLUS Default with no LIST=
Line 9 inputs data to the program from the VPLUS screen vorderline. There is nothing on
this line to indicate which data items to retrieve. In this default case, Transact looks at the
form definition in Dictionary/V to determine which data items are involved. If we wanted
to be explicit, we could have made this line read:
2 list order-no: |
| 2.1 cust-no: |
| 2.2 order-status: |
| 2.3 order-date; |
| 3 list line-no: |
| 3.1 part-number: |
| 3.2 quantity;
9 get(form) vorderline,fkey=lastkey;
10 put orderline,list=(order-no,
11 line-no,
12 part-number,
13 quantity);