Calling Library Procedures
To call a procedure for which you have the object code but no source code, perform the following steps to link the procedure into an application:
1. Specify the link options filename in the Applications Defaults window, or with the ING_ABFOPT1 logical or environment variable. The filename specified in the Application Defaults window overrides the value specified by the ING_ABFOPT1 logical or environment variable.
2. List the object file for the procedure (or the library that contains the object code) in the link options file.
3. Define a library procedure to ABF. Use the same name for the procedure as you use in the callproc statement. Set the symbol to refer to the procedure. The symbol name can differ from the procedure name.
The reference is resolved later in the link list using the object files and libraries specified by the default link options file.
ADA procedures are always library procedures.
Examples
This example calls the 4GL procedure addtax, passing the taxpercent field by value and the price field by reference. Thus, a computed value can be returned in the price field:
callproc addtax (tax = taxpercent,
total = byref(price));
The following example checks whether the global variables in an application have been set. If not, it calls the procedure Set_globals to set them. Create the integer global variable, globals_set, in ABF.
if (globals_set = 0), then
/* indicates that globals are not set */
callproc set_globals();
/* set_globals sets the values */
/* for the global variables */
globals_set = 1:
/* indicates that globals are now set */
endif;
Last modified date: 04/03/2024