Example: custdata.4gl (top definitions)

The top of the custdata module implements a couple of types and variables.

The top of the custdata.4gl module:
 1 IMPORT FGL comutils
 2
 3 SCHEMA custdemo
 4
 5 PUBLIC TYPE t_custrec RECORD LIKE customer.*
 6 PUBLIC TYPE t_cust_num LIKE customer.cust_num
 7
 8 PRIVATE DEFINE mr_custrec t_custrec
Note:
  • Line 1 imports public symbols from the comutils module, such as the mbox_yn function, to ask a question to the user.
  • Line 3 declares the database schema to be used for LIKE tabname.colname definitions.
  • Line 5 defines a user type t_custrec, based on all the column names and data types of the customer table.
  • Line 6 defines a simple type t_cust_num with the type of the customer number column.
  • Line 8 declares a module variable mr_custrec with the t_custrec type. This variables is private to the module and cannot be seeing by importing modules.