2. Writing Scripts and Procedures : Calling Procedures : How You Can Call 4GL Procedures
 
Share this page                  
How You Can Call 4GL Procedures
The callproc statement lets you call a global 4GL procedure from any OpenROAD script or another 4GL procedure. You also use the callproc statement to call a local procedure defined in the current frame or procedure.
In the simplest version of the statement, you can call a procedure with no return value or parameters. The basic syntax is:
callproc procedurename
procedurename
Specifies the name that you gave to the 4GL procedure when you created it. You can enter the procedure name directly or you can use a variable to specify the procedure name dynamically. Using a variable lets you specify the procedure name at runtime.
The following example shows the use of this statement:
callproc error_handler;
When the procedure returns a value, you must specify a variable in the calling frame or procedure to receive the return value. The return variable must be the same data type as the return value. The basic syntax is:
[return_variable =] callproc procedurename