Example: custlist.4gl (header)
The custlist.4gl header declares the schema to be used, the types and module variables.
The custlist.4gl module header:
1 SCHEMA custdemo
2
3 PRIVATE TYPE t_cust RECORD
4 cust_num LIKE customer.cust_num,
5 cust_name LIKE customer.cust_name,
6 city LIKE customer.city
7 END RECORD
8
9 PRIVATE DEFINE custarr DYNAMIC ARRAY OF t_cust
Note:
- Lines
1
declares the database schema forLIKE
instructions. - Lines
3
thru7
define thet_cust
type with the customer number, name and city fields, using the same data type than thecust_num
,cust_name
andcity
columns of thestock
table. - Line
9
defines the dynamic array in the scope of the module, that holds the list of customers fetched from the database table.