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 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.

Figure: Genero compilation tools

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

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.

Figure: Linking of compiled modules

Linking of compiled modules diagram

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.