The call with name statement transfers temporary control to the named procedure. The procedure to run is specified at runtime.
call {background | remote} with name procedure_name {in dictionary product_ID} {, parameter, parameter,...}
• background | remote – Indicates whether the procedure will be processed in the background or remotely by a process server. The background parameter runs the procedure in the background while the computer continues running the calling script in the foreground.
• The remote keyword sends the procedure to a process server in the service named by the begingroup statement preceding this statement. If the begingroup statement wasn’t used, the called procedure will be run in the background.
• procedure_name – A string expression or variable containing the name of the procedure you want to call.
If you are calling a form-level procedure, use single quotes around the procedure name, within the string expression. Calling a form-level procedure is shown in the second example. |
• in dictionary product_ID – A clause containing the integer product ID for a third-party dictionary containing the procedure you want to call.
• parameter – Values, such as tables or fields you wish to pass to or return from the procedure. Up to 256 parameters can be passed to or returned from the called procedure.
You can use the Process Monitor to monitor the progress of procedures.
The call with name statement transfers temporary control to a procedure, passing information to it. If the background keyword is not used, the called procedure can pass information back to the calling script. If the background keyword is used, the called procedure is queued for execution in the background. If that background procedure calls another procedure, that procedure will also be run in the background. Background procedures must be completed before users are allowed to exit your application.
You can’t pass a table buffer when calling a procedure to run in the background because the form where the calling script originates might be closed before the background procedure is run. In such a case there would be no table buffer for the procedure to use. Similarly, you can’t pass a temporary table to a background procedure, since the temporary table may no longer exist when the background procedure is processed.
When using call with name to call procedures with optional parameters, you must include all of parameters in the call, including any optional parameters at the end of the parameter list.