In addition to running immediately, procedures can be run in the background or remotely on a process server.
When creating procedures to run in the background or remotely, be careful not to reference forms and windows that may not be open when the procedure is actually run.
Background processing allows a procedure to run while other processing is occurring, such as opening windows, printing reports and so on. To run a procedure in the background, include the background keyword in the call statement. This will add the procedure to a processing queue that will process it when time is available.
If a procedure is called in the background, any additional procedure or function calls made from the initial procedure will run in the background. The background parameter doesn’t have to be specified in such subsequent calls.
Temporary tables can’t be passed to a procedure running in the background because the temporary tables may no longer exist when the procedure is processed. If a temporary table is necessary, it should be created within the procedure.
You can monitor the progress of background procedures by choosing the Process Monitor menu item. Background procedures must be completed before you exit Dexterity. If you attempt to exit Dexterity when a background procedure is running, a message will alert you that background processes are still running. For this reason, procedures that run indefinitely should not be run in the background.
You can also process procedures remotely by sending them to process servers. To send a procedure to a process server, you must set up a process group and include the remote keyword in the call to the procedure. Process groups are described in the next section.
Only procedures meeting certain criteria can be sent to a process server. For instance, the procedure can’t generate any dialog boxes or messages since no users will be at the server to respond to the message.