Create and Register 3GL Procedures and Database Procedures
You can create a 3GL procedure or database procedure after you register it.
Register a 3GL Procedure or Database Procedure
You must register all database procedures and those 3GL procedures that you call directly from your 4GL code. You need not register 3GL procedures that are called only from other 3GL procedures. You register procedures on the Develop tab.
Note: You can create numbered versions of 3GL procedures.
To register a 3GL procedure or database 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, 3GL Procedure or File, New, Database Procedure.
The appropriate Create Procedure dialog appears.
3. Enter a name for the 3GL procedure or database procedure in the Name field (for example, My_3GL_Procedure).
4. (Optional) Enter a comment for the component in the Remark field.
5. Click Create.
The appropriate editor (3GL Procedure or Database Procedure Editor) appears.
6. Specify the properties for the procedure. For example, click Browse in the 3GL Procedure Editor.
A standard File Selection dialog appears.
7. Select the DLL file containing the desired procedure (for example, libq32_1.dll).
Your choice is entered in the Library Name field:
8. (Optional) Click Strip Path to strip the file's path from the Library Name entry field.
9. (Optional) Specify other properties for the procedure.
10. Save the procedure by selecting the appropriate command from the File menu.
Create a 3GL Procedure or Database Procedure
You create procedures in the Script Editor.
To create a 3GL procedure or database procedure
1. Write the procedure in the appropriate language using the Script Editor.
2. Make the procedure available for use by your application as follows:
For 3GL procedures
For database procedures
Create the procedure as part of your database.
3GL Procedure and Database Procedure Properties
Note: The only property you can set for a database procedure is its Remark.
3GL procedures have the following properties:
Library Name
Defines the location where the library is located. When you click Browse, a standard File Selection dialog appears. The StripPath option strips the path from the library name.
Return Value Data Type
Specifies the data type of the value returned by the procedure:
• None
• Varchar
• Smallint
• Integer
• Float
• Money
• Date
Language
Specifies the language in which the 3GL procedure is written:
• C
• PASCAL
• C_PASCAL
View and Edit 3GL Procedures and Database Procedures
You can view and edit 3GL procedures and database procedures on the Develop tab.
To view the properties of a 3GL procedure or database 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. Select the procedure in the Components portlet.
3. Click File, Open or File, View.
The appropriate editor—3GL Procedure or Database Procedure Editor—appears.
Note: If you select Open, you can change any of the procedure properties.
4. Click File, Close and save your changes appropriately.
Delete a 3GL Procedure or Database Procedure
You can delete a 3GL procedure or database procedure on the Develop tab.
To delete a 3GL procedure or a database 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. Select the procedure in the Components list.
3. Click Edit, Delete.
A standard confirmation dialog appears.
4. Click OK to confirm the deletion.
Workbench deletes the procedure.
Note: You must also remove all instances of the deleted component from your code, or you will receive an error message when Workbench compiles your application.