Program entity
A Program entity contains the information needed to generate the main logic to drive the application.
Until you implement the program, the Program entity on the BA diagram is simply an icon. To implement the program, right-click on the Program entity and select Implement Program. This creates the 4prg file which represents the Program entity and is used to generate the program code. It also creates placeholders for the generated code (4gl) files:
- The Program.4gl file contains the custom code for the program.
- The
Program_prg.4gl
file contains the
MAIN
function. It defines connects to the data source using theCONNECT TO
statement, loads styles and action defaults files, and performs some initialization tasks for the application. - The Program_events.4gl file defines the events and the callback function definitions for the program.
Any changes to the diagram are included in the subsequent re-generation of the program code.
The generated code can be customized; see Adding custom code.
To build the source code for the program based on the related entities in the diagram, right-click on the Program entity and select Build Program. This generates the Genero source code (.4gl) files and compiles them into the executable (.42m) files.
To execute the application from the BA diagram, right-click on the Program entity and select Execute Program.
You can also execute the application in the same way as any standard application: by right-clicking on the configuration and selecting Execute, or by setting the application as the default and executing it from the toolbar icon.