6.06 External Calls

EXEC Command

Function:

Loads a secondary copy of the system shell and executes a program or a shell command.

Syntax:

EXEC cmdstr

where:

cmdstr
Shell specific command string

After the specified shell command or program terminates, control is returned to the line following the EXEC command.

If the first character of the command string is an ampersand (&) the command returns immediately without waiting for the command to complete.

EXEC Function

Function:

EXEC(command) 

EXEC() is the function version of the EXEC command. The difference is that the EXEC function returns an array containing the output of the 'command' where each element is a text line from the called program.

Windows: The stdout and stderr are separated! First is stdout output and then stderr.

If the first character of the command string is an ampersand (&) the command returns immediately without waiting for the command to complete.

Implementation Differences:

LynPlex Interpreter
Fully implemented.
LynPlexC Compiler
The exec command is not supported. The exec function is supported but with the arguments as a separate argument to the function call.
The function also just returns the error code.
LynPlexS Compiler
The exec command is not supported. The shell function provides a similar facility to the exec function.
The function also just returns the error code.
The shell function does not wait for completion of the command if it is prefixed by a colon(:).

lynplex/lp0606.txt · Last modified: 2013/05/29 20:39 (external edit)