How You Can Pass Parameters to 4GL Procedures
To pass a value to a 4GL procedure in the callproc statement, you specify the name of the parameter in the 4GL procedure that is to receive the value. The basic syntax is:
[return_variable =] callproc procedurename [(parameter = expression
{, parameter = expression})]
parameter
Assigns the expression in the callproc statement to the parameter in the called procedure that you declared with the procedure statement. For more information about declaring procedure parameters, see the Language Reference Guide online help.
Because you specify the parameters by name rather than by position, you can pass them in any order, and you need not pass all the parameters.
expression
Specifies a constant or any legal OpenROAD expression, as long as the resulting data type is compatible with the data type of the local variable in the procedure. Variables in the expression can be any type, including reference variables and array variables.
The following example from the video_list frame script uses the callproc statement to call a procedure that removes a row from the video_detail frame:
callproc remove_new_detail(new_details_frames =
new_details_frames, details_frame =
video.details_frame);
Any variable in the procedure that you do not specify in the parameter list is set to its default value.
Parameters to 4GL procedures can be passed by value and by reference. For a discussion of passing parameters by value and by reference, see
How You Can Pass Parameters Between an Active Child and Inactive Parent (see
How You Can Pass Parameters Between an Active Child and Inactive Parent).
The value of the referenced variable is not updated until the called procedure returns. At this point, the variable in the calling frame is updated the same way it would be if you had used an assignment statement. If a field on the form is associated with the variable, the field does not display the new value until the current event block completes. To cause the value to update before the end of the event block, you can use the Flush method immediately after the callproc statement. For more information about the Flush method, see the Language Reference Guide online help.