Notes | This statement either runs a specified Equinox task, for example a form or report, or an external program. Equinox tasks may be run locally (in the currently executing client) or remotely (in another client on the local machine or in a client running on the server). The statement ExecuteSetRemote configures a task to run remotely. Tasks do not run remotely on single-user copies of Equinox; however applications can be configured to run single or multi-user without change if required.
The first argument, TaskName, describes the type of task to execute.
FileExpression is a string and identifies the specific task file name (if required). If you do not specify a path for the file, then Equinox will search for the file. The search process used depends on the type of file specified.
For Equinox parameter files, Equinox will start in the dictionary directory (below the PARAMS directory). If the file is another directory, then you must include the relevant path.
For non-Equinox files, Equinox searches the following directories (in the specified order): the current directory, the Windows and Windows system directories (for Windows installations only), the Equinox directory and any other directories in the system PATH variable.
The following table describes the values that TaskName (and FileExpression) can take, and whether the task can run remotely:
Task | Action |
Command | Run an external program in the foreground FileExpression specifies an executable file name and optional parameters. |
ConvertAllDatabases | Convert all databases to the storage manager DLL specified in FileExpression, which should be surrounded in quotes, for example "SQLDBMS.DLL". Use " to convert back to Equinox native format. |
CorrectAllMirrors | Corrects the mirror for all Databases |
CorrectMirror | Corrects the mirror for a single selected Database |
CorrectMirrorTable | Corrects the mirror for a single selected Table |
DeleteDatabase | Takes a database name (not in quotes). Optimise permission is required for the user executing the code. |
EmptyDatabase | Clear all records from a database. FileExpression contains the name of the table and should not be surrounded in quotes. The database is emptied starting from this table, working down the hierarchy.
Can run remotely but you must ensure you exit the client within 30 seconds to allow the remote task to gain an exclusive lock on the definition. |
Export | Run an export. FileExpression specifies the export definition file name. The name of the merge file should first be stored in the system workarea SysFilename. SysConfirm may be set, to prevent the file dialog from appearing. Can run remotely. |
ExportSetup | Edit an export. FileExpression specifies the export definition file name. |
Form | Use a form for data entry. FileExpression specifies the form definition file name. |
FormSetup | Edit a form. FileExpression specifies the form file name. |
FormSwap | Unload the current form and run a new one. FileExpression specifies the form definition file name. |
Import | Run an import. FileExpression specifies the import definition file name. The name of the merge file should first be stored in the system workarea SysFilename. SysConfirm may be set, to prevent the file dialog from appearing. Can run remotely. |
ImportSetup | Edit an import. FileExpression specifies the import definition file name. |
Method | Suspend the current application method and run a new one. FileExpression specifies the method's file name. Can run remotely. |
MethodSetup | Edit an application method. FileExpression specifies the method's file name. |
MethodSwap | Terminate the current application method and run a new one. |
Menu | Suspend the current menu and load a new one. FileExpression specifies the menu definition file name. |
MenuSetup | Setup an application menu. FileExpression specifies the menu definition file name. |
MenuSwap | Terminate the current menu and load a new one. FileExpression specifies the menu definition file name. |
OptimiseDatabase | Optimise a database. FileExpression contains the name of the database and should not be surrounded in quotes. See OptimiseDatabase for instructions on running remotely. |
OptimiseAllDatabases | Optimise all databases (Includes the System database). Cannot be run remotely at present. |
Process | Run a batch process. FileExpression specifies the process definition file name. Can run remotely. |
ProcessSetup | Edit a batch process. FileExpression specifies the process definition file name. |
Query | Run a Query. FileExpression specifies the query file name. |
QuerySetup | Edit a Query. FileExpression specifies the query file name. Can run remotely. |
QuerySetupNew | Specify the default table used in query design. FileExpression just contains the name of the table and should not be surrounded in quotes. |
Report | Run a report. FileExpression specifies the report file name. Cannot be run remotely. See Execute Report |
ReportPreview | Run a report in preview mode. FileExpression specifies the report file name. |
ReportSetup | Edit a report. FileExpression specifies the report definition file name. |
ReportSetupNew | Specify the default table used in report design. FileExpression just contains the name of the table and should not be surrounded in quotes. To sort report records, add a comma then the index name after FileExpression. |
Shell | Load CMD.EXE (under Windows NT) or COMMAND.COM (under Windows 9x) into the foreground. FileExpression specifies an MSDOS executable file, or an MSDOS command. n.b EQSHELL.PIF is still used in Equinox 2x, no longer required for Equinox 3). |
System | Load CMD.EXE (under Windows NT) or COMMAND.COM (under Windows 9x) into the background and wait for the command to finish before returning control to Equinox (abortable via ctrl-break). FileExpression specifies an MSDOS executable file, or an MSDOS command. n.b EQSHELL.PIF is still used in Equinox 2x, no longer required for Equinox 3). |
Task | Run the specified program in background (only available under Windows). FileExpression specifies the executable file name. |
UserManagement | Modify application user details |
VerifyAllDatabases | Optimise all databases that have not been closed properly. Can run remotely. |
VerifyAllMirrors | Checks that data in all mirrors corresponds to the data in Equinox. The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero. If the task was a remote one, SysReply contains the task handle of the remote task, zero if it has finished, or -1 if it is not running. SysResult contains the status of the task:
- -4 Operational error. The remote client is improperly configured or installed.
- -3 Unable to execute. For example, the parameter file did not exist.
- -2 Did not start. The remote client executed and logged in, but was unable to initialise.
- -1 Running
- 0 Finished ok
- 1 Finished with an error. SysError was nonzero after the task finished in the remote client.
- 2+ Finished with a user defined result. The remote task executed a statement SysResult = value.
|
VerifyDatabase | Optimise a database if it has not been closed properly. FileExpression just contains the name of the database and should not be surrounded in quotes. Can run remotely. |
VerifyMirror | Checks thata data in a mirror corresponds to the data in Equinox. FileExpression contains the name of the mirrored database and should not be surrounded in quotes. |
VerifyMirrorTable | Compare the Equinox data against the Mirrored data and report errors |
If the task was external, on Win32 environments SysReply contains the value of GetLastError if an error occurred, otherwise the handle from CreateProcess.
Note that if you use the Execute statement to run a local task in a method attached to a form, control does not return to the method. The form is reloaded from scratch after the task is completed. This means that the statement cannot execute while a record is being inserted or edited. Also note that you cannot run a local task in the At Start of Task or At End of Task methods on a form. A compilation error will occur.
The following new commands are available:
- CorrectMirror
- CorrectAllMirrors
- VerifyMirrorTable
- CorrectMirrorTable
These commands check the Equinox records in the database tables or table specified against the mirror version, and if required, the "Correct" versions correct the mirror data. If a priority of 3 (low priority) is specified in the preceding ExecuteSetMode statement and the ECC is available (client-server), the task is added to the ECC table list for processing in the background by the server. For example:
ExecuteSetMode -1,,, 3
Execute CorrectMirrorTable Orders
Otherwise the task runs in the foreground as specified by the remaining ExecuteMode parameters, as normal.
The following statements affect mirror operations but are not part of the ECC:
- MirrorDisable
- MirrorVerifyRecord
|