System

System allows you to execute system orders and to obtain the information sent by the order on the standard output.

Syntax

(1) System EXPR_ORDER(2) System VAR_RET = EXPR_ORDER(3) Local File (VAR_LIST) From System EXPR_ORDER As [CLASS]
The syntax 3 is described in the [File](../4gl/file.md) documentation. The parameters are the following:

Examples

 # Copy FILE1 to FILE2 with stderr redirection on UNIXSystem "cp "+FILE1+" "+FILE2-"2>/dev/null"# List of a directory on a Windows server on which the first reference folder is located# Returns the list of files and the number of lines read# If no directory is given we default it with a temporary directorySubprog DIRECTORY_LIST(FILES,DIRECTORY,NUMBER)Variable Char FILES(100)(1..)Value Char DIRECTORY(100)If DIRECTORY="" : DIRECTORY = "C:\sage\tmp" : EndifSystem FILES = adxmac(1)+"@DIR/b/o:n"+DIRECTORYNUMBER=stat1End

Description

System executes a system order. The server in which the system order must be executed can be given in the system order expression:

If a variable is given (syntax 2), the standard output is sent back to this variable. The stat1 variable returns the number of lines sent back (it can be greater than the dimension of the variable: in this case, the remaining lines are lost).

Execution restriction in Clouds environment

For obvious security reasons, the execution of this instruction is controlled on Clouds environments:

When the execution is denied, an error 27 is raised.

For more information, look at the sandbox configuration page.

See also

stat1, File.