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 for LIKE instructions.
  • Lines 3 thru 7 define the t_cust type with the customer number, name and city fields, using the same data type than the cust_num, cust_name and city columns of the stock table.
  • Line 9 defines the dynamic array in the scope of the module, that holds the list of customers fetched from the database table.