run

 

The RUN statement is used to invoke an operational system command or run a 4GL or any other application. Its syntax is as follows:

 

RUN command [WITHOUT WAITING | RETURNING result]

 

where:

·         command = a quoted character string specifying the command to be executed or the application to launched, or a variable of the character data type (which can also be a record member or an array element), containing an application name and the path to it if required,

·         result = an INTEGER variable standing for the termination status code of the command invoked (TRUE in case of success, and FALSE otherwise).

 

 

The RUN statement cannot include both the WITHOUT WAITING keywords and the RETURNING clause, as the latter presupposes, that a parent application requires the result of a child application execution.

 

 

Usage

 

The commands specified in the RUN statement are executed on a server side. For example, on the RUN "notepad" statement execution, the notepad will be launched on the server (not on the client).

 

The RUN statement can be used to execute a child 4GL application from within the parent one. When used for this purpose, it affects an application workflow as follows (unless the WITHOUT WAITING keywords are specified):

Description: RUN_app_workflow.png

If the RUN statement contains the WITHOUT WAITING clause, it means that the two applications are being executed concurrently (no suspend in the parent application execution takes place).

 

The example below illustrates how an application can be executed from within another application:

 

RUN "app_name.exe"

 

The  application must be located in the Lycia AppServer  work directory (progs) or the path to it must be specified by the environment variable  $PATH.

 

If any argument of a RUN statement includes spaces, this argument must be enclosed in double quotation marks - "" (to ensure that this argument is processed as one logical entity):

RUN '"my app" arg1 "arg 2"'