SYSTEM |
DEVELOPER |
Trail: PROIV Documentation > Developer > PROIV Developer > Developing Functions > Events and Logic > SYSTEM
|
|
Purpose |
SYSTEM (or the ‘!’ prefix to the kernel command prompt), allows a program to be executed from PROIV. |
Syntax |
RC = SYSTEM(statement) |
Operation |
RC is a scratch variable containing a return code indicating the status, success or failure, of the call itself (and not the success or failure of any program called). |
Remarks |
The value of the return code depends upon the Operating System; usually a return code of 0 (zero) indicates success. This command is typically used to invoke an externally defined program; when the external program has finished, control can be returned to PROIV. The command string must be a literal surrounded by quotes. Any command within the quotes must be an operating system level command according to the current platform. See also SYSTEM-CRT |
Example 1 |
This command calls program prog1: #RC = SYSTEM("prog1") |
Example 2 |
This command copies the contents of filea to fileb: #ST = SYSTEM("copy filea fileb") |
Example 3 |
This command copies the contents of a file specified by the scratch variable $FILEA, to fileb: #ST = SYSTEM("copy " + $FILEA + " fileb") |
Example 4 |
This is a System call to server machine #STAT = System(“<command>“) |
Example 5 |
This is a System call to a Windows application: #STAT = System(“WINDOWS <command>“) |
Example 6 |
This System call executes the command using older versions (prior to version 127) of the MFC GUI: |
Example 7 |
If no explicit path is defined: |
On PROIV version 1.1, SYSTEM resets the terminal connection characteristics before and after executing the external command. This does not happen on version 1.2 and later, and if you already use SYSTEM with an input/output screen, you may be required to use SYSTEM-CRT. |
Topic ID: 520126