system

This function starts a Microsoft Windows command line and passes a command to it. You can also specify to wait for the result of the command line.

system ( command, wait Y/N )

The result of this function is of type NUMBER. Refer to below for the meaning of the return codes.

This function has two parameters.

  1. command, type TEXT; the command line to be executed. This command line must be a valid Microsoft Windows command line.
  2. wait, type TEXT; Y or N. When you set this parameter to Y ITP will wait until the started command terminates. When you set this parameter to N ITP will continue as soon as the command has been started.

Return codes

The result of the function is of type NUMBER and can be one of the following values:

<0 :

The command could not be started. The values is equal to the negative error code.
Waitparameter is N:

0:

The command was started.
Waitparameter is Y:

>= 0:

The command was started. The value is equal to the return code of the command.

Example

NUMBER return_code 

ASSIGN return_code := system("c:\winnt\system32\notepad.exe" ; "N")
#
@(return_code)
#

Note

Note that it only works if notepad is indeed located in c:\winnt\system32.