Getting Started with TRANSACT (32247-90007)
158 Chapter9
Creating Custom Applications
Form Independence
Figure 9-6. Screen Independence Via Indirect Referencing
1 system custup,base=orders
2 ,vpls=formfile
3 ,file=formxref;
4 define(item) menuname x(16):
5 fkey 9(2):
6 screen x(16):
7 lastkey i(4);
8 list menuname:
9 lastkey;
10
11 data menuname; <<to simulate transfer of control to this subroutine>>
12
13 <<
14 *************************************************************
15 Subroutine: to update customer information
16
17 input: menuname - contains the name of the screen to be displayed
18
19 output: none
20 *************************************************************
21 >>
22 level;
23 list fkey:
24 screen;
25 list(auto) customer;
26 get(form) (menuname),init
27 ,window=(" ")
28 ,fkey=lastkey
29 ,autoread;
30 if (lastkey) = 0
31 then perform modify
32 else
33 do
34 set(match) list (menuname);
35 let (fkey) = (lastkey);
36 set(match) list (fkey);
37 get(serial) formxref,list=(menuname,fkey,screen);
38 reset(option) match;
39 perform modify;
40 doend;
41 end;
43 modify:
44
45 set(key) list (cust-no);
46 get customer,list=(@);
47 put(form) (screen),window=("update? - f1=yes, f2=no");
48 get(form) (screen),f1(autoread)=modify-f1
49 ,f2=modify-f2;
50
51 modify-f1:
52
53 update customer,list=(@);
54
55 modify-f2:
56
57 end;