Compiling and Running the Program
You can compile and execute programs in Genero Studio or use fglcomp, fglform, fglrun command line tools if you prefer.
From Genero Studio
The Execute option in the Genero Studio Project view will compile and link files in the specified application node if necessary before executing the application. You can also compile individual modules or build an application as independent steps.
To compile and execute the simple program in Genero Studio:
- In the Project view, expand the BDLTutorial project and find the chap02 group.
- Expand the chap02 group and the simple application node. Right-click on the simple configuration node and select Execute.
From the command line
The following tools can be used to compile and execute the simple
program from
the command line.
- Open a terminal / console with Genero enviroment set, to find the command line tools such as fglcomp and fglrun.
- Go to the directory where the module is stored, for example, My Documents\My Genero Files\samples\BDLTutorial\chap02\simple.
- Check the locale settings before compiling your source code. To support all possible languages,
you want to use UTF-8 character encoding with character length semantics:
fglrun -i Charmap : UTF-8 Multibyte : yes Stateless : yes Length Semantics : CHAR
- Compile the module program, to produce the pcode file simple.42m:
fglcomp simple.4gl
- Execute the program with fglrun, passing the pcode file as parameter:
fglrun simple.42m
Tip:
By default, if a source file contains an error, fglcomp will produce a
filename.err file. Use the
-M
option with
fglcomp, in order to print errors to the standard error
stream:fglcomp -M simple.4gl
You can compile and run a program with a single command, by chaining the commands with the
&&
shell directive:
fglcomp -M simple.4gl && fglrun simple.42m