Add and implement a program

Implementing a program entity on the BA diagram creates the 4prg file, which is used to generate the program code.

  1. Open the BA diagram to which you want to add a program.
  2. Right-click on the diagram and select New > Program to add a new Program entity.
  3. Rename the Program entity.
  4. In the Projects view, create an application node to hold the program.
    A configuration node is automatically created as a child of the application node.
  5. Ensure that the Language property of the application node is set to Genero (no link).
  6. Right-click the program entity and select Implement Program.
  7. In the Path field, name the 4prg file including the full path.
    Note:

    It is recommended that you save the file to the src directory of your project.

  8. Ensure the Insert the file in the project checkbox is selected, and select the application node you created.
  9. Click OK to save the program.
  10. Select the configuration node, and set the BinaryName property to the name of the program entity file with a _prg suffix. For example, if the program entity file is MyApp.4prg, the BinaryName should be MyApp_prg.
The project now contains:
  • The 4prg file
  • The Intermediate Files folder, with placeholders for the 4gl and xml source files to be generated.
Figure: Program entity following implementation

This figure shows a program entity called MyApp in the BA diagram and the an application node called Application02 in the Projects view. The Application02 node includes an Intermediate Files folder, with files MyApp.4gl, MyApp.xml, MyApp_events.4gl, and MyApp_prg.4gl. The Application02 node also includes a Configuration node and a MyApp.4prg file.
Note:

One of the intermediate files (program_prg.4gl) matches the binary name of the configuration node program_prg. This means that when you execute the application, you are executing the generated program_prg.42m file.