SYSTEM
Sends a command to the operating system.
Syntax
SYSTEM expression [RESET|CLOSE] [INVISIBLE] [BACKGROUND | REMOTE]
Parameters
expression | Any expression that evaluates to a character string. Expression may include constants, variables, parameters, functions, and so on. |
RESET | Causes all of the software’s internal data buffers to be flushed to disk. |
CLOSE | The CLOSE option does not do anything anymore and it is ignored. |
INVISIBLE | Allows the command specified in expression to be executed without affecting the screen display. |
BACKGROUND | Indicates that the command specified in expression is to be executed asynchronously while Zim continues to run. Many operating system commands can be processed concurrently. When BACKGROUND is omitted, execution is suspended while the operating system executes the specified command. |
REMOTE | Only applicable to Zim Thin Client, it executes the operating system command specified in expression in the server side. |
Comments
SYSTEM sends the command represented by expression to the operating system. For expression to be successfully executed, it must be meaningful to the operating system. Any software required for the execution of expression must be available to the system.
The SYSTEM command runs synchronously by default; the BACKGROUND subcommand can be used to force any SYSTEM command to execute asynchronously.
Note: For batch files, precede the command with an exclamation mark (!).
Note: There is no sense issuing the command SYSTEM with CMD, COMMAND or SH and the option BACKGROUND because it will require user interaction but there is no visible window to do it. The result is that Zim will wait for an event (closing the operating system window) that will never occur.
Note: The CLOSE option is ignored in Zim 9. Until Zim 7.x, it was intended to be able to copy Zim files around while guaranteeing that they would not be in a volatile state. Now, ZimServer possesses all Zim files and they cannot be closed or moved around at will because this creates breaches in the database security. In a well maintained working environment, users never have access to the Zim database files located in the server machine, thus ensuring maximum safety and security of the database. The only exception is when dealing with PER USER files: in this case, there is the statement INITIALIZE PERUSER which creates per user file on the fly without the need of copying any Zim files around nor saving “blank” copies of these files.
Example
find Customers where LastName = “Smith” and FirstName = “John”
system $concat(“archive “, fCustomers.cc, “.dat”)
If the cc value is 7592, then this command invokes a program called “archive” to archive the data file by passing the command archive 7592.dat to the operating system.
system “erase c:\\file.dat”
In systems where the path delimiter character is the backslash, remember that the backslash is also the escape character in character strings. Two backslashes are required, as shown above, to send the backslash to the operating system.
set escapechar off
system “erase c:\\file.dat”
set escapechar on
In the above example, SET ESCAPECHAR is used to turn off use of the escape character in character strings. Or, use SET SPECIALSCAN to switch off use of all reserved characters in text strings.
Note: See the user documentation for your operating system.