Compiling a program

You need to compile the source files in order to run the application.

A program can consist of a single source code module, but generally it will be organized in multiple modules, will involve form specification files and perhaps localized string files.

Database schema files are required when you define program data types and variables in the terms of an existing database column or table, by using the DEFINE ... LIKE statement.

Before running your application with the runtime system, you need to use compilation tools in order to build the various runtime files.


Genero compilation tools diagram: tools are fgldbsch, fglcomp, fgllink, fglform, fglmkstr

Figure 1. Genero compilation tools

The compiled source code modules can be linked into a .42r program that can be executed by the Runtime System. Compiled modules can also be grouped together into a.42x library that can then be used to build .42r programs.


Linking of compiled modules diagram

Figure 2. Linking of compiled modules

It is also possible to declare what modules are needed by the current module with the IMPORT FGL instruction, in order to define the dependency between .4gl modules. When using this language feature, it is no longer required to link modules together to build a program.

IMPORT FGL cust_module
MAIN
    DATABASE stores
    CALL cust_module.input_customer()
END MAIN

Importing modules is the preferred solution.