call

Examples


The call statement transfers temporary control to a procedure.

Syntax

call {background | foreground | remote} procedure {of form form_name}{, parameter, parameter...}

Parameters

background | foreground | remote – Indicates whether the procedure will be processed in the background, foreground or remotely by a process server.

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.

The foreground keyword starts a procedure that runs in the foreground. This can be used to assure that a block of sanScript statements is not interrupted by user interaction with the application. Refer to the examples for more information about using the foreground keyword.

procedure – The name of the procedure you want to call.

of form form_name – A parameter that must be included if the procedure is a form procedure. The form_name parameter is the name of the form the procedure is attached to.

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.

Comments

You can use the Process Monitor to monitor the progress of procedures.

The call 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.


Documentation Feedback