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_custrecNote:
- Line
1imports public symbols from thecomutilsmodule, such as thembox_ynfunction, to ask a question to the user. - Line
3declares the database schema to be used forLIKE tabname.colnamedefinitions. - Line
5defines a user typet_custrec, based on all the column names and data types of the customer table. - Line
6defines a simple typet_cust_numwith the type of the customer number column. - Line
8declares a module variablemr_custrecwith thet_custrectype. This variables is private to the module and cannot be seeing by importing modules.