14. Adding Other Components to Your Application : Procedures : Create a 4GL Procedure
 
Share this page                  
Create a 4GL Procedure
A 4GL procedure is a set of 4GL statements that you can call by name in an application. 4GL procedures are written in fourth-generation languages such as Java. You can create, edit, and delete 4GL procedures on the Develop tab.
To create a 4GL procedure
1. In the Applications portlet of the Develop tab, select the application in which you want to create, edit, or delete a component, and then select the header bar of the Components portlet to make it active.
2. Click File, New, 4GL Procedure.
The Create Procedure dialog appears.
3. Enter a name for the procedure in the Name field (for example, My_4GL_Procedure).
4. (Optional) Enter a comment for the component in the Remark field.
5. Specify the properties for the procedure.
For descriptions of each property, see 4GL Procedure Properties (see 4GL Procedure Properties).
6. Click Create.
Workbench displays the 4GL Procedure Editor. Workbench also calls the Script Editor (or your system editor) and displays a script template containing the keywords required for a 4GL procedure for you to write the procedure code:
7. Write the script for the procedure.
For more information about using the Script Editor to write procedures, see Writing Scripts and Procedures (see Writing Scripts and Procedures).
8. Click File, Close in the Script Editor.
9. (Optional) Click Tools, Compile in the 4GL Procedure Editor to compile the procedure.
Note:  This step is not required because OpenROAD automatically compiles the procedure the next time you run the procedure. For more information, see How You Can Compile 4GL Procedures.
10. Click Debug, Go in the 4GL Procedure Editor to test the procedure.
To stop running the procedure, click Debug, Stop.
Note:  You also can use the Workbench's Run toolbar button to test the current application, thus ensuring that the procedure receives any parameters it needs from the frame or procedure that calls it. For more detailed information, see Running an Application (see Running an Application).
11. Save the 4GL procedure by selecting the appropriate command on the File menu.