Getting Started with TRANSACT (32247-90007)

Chapter 3 69
Using VPLUS and IMAGE
Reporting Data from a Dataset
Figure 3-17. Program with VPLUS Freeze and Append
2 We define an element local to this program called counter. It is an integer
that can store a 4-digit number, e.g. <= 9999.
3 LIST includes this new element in the list of variables that our program
can access. The INIT option initializes its value to zero.
1 system ex29,base=orders,vpls=formfile;
2 define(item) counter i(4);
3 list counter,init;
4 list(auto) customer;
5 put(form) vcustomerrh,freeze;
6 find(serial) customer,list=(cust-no:zipcode)
,perform=display-record;
7 if (counter) > 0
8 then update(form) vcustomerrd,list=()
,wait=
,window=("press f1-f7 to
continue");
9 exit;
10 display-record:
11 let (counter) = (counter) + 1;
12 if (counter) = 5
then
do
13 let (counter) = 0;
14 put(form) vcustomerrd,wait=
,window=("press f1-f7 to continue")
,append;
doend
15 else put(form) vcustomerrd,window=(" ")
,append;
16 return;