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 thecomutils
module, such as thembox_yn
function, to ask a question to the user. - Line
3
declares the database schema to be used forLIKE tabname.colname
definitions. - Line
5
defines a user typet_custrec
, based on all the column names and data types of the customer table. - Line
6
defines a simple typet_cust_num
with the type of the customer number column. - Line
8
declares a module variablemr_custrec
with thet_custrec
type. This variables is private to the module and cannot be seeing by importing modules.