EXEC


Temporarily transfers execution to an external program

Syntax:
declare function Exec ( byref program as const string, byref arguments as const string ) as long

Usage:
result = Exec( program, arguments )

Parameters:
program
The file name (including file path) of the program (executable) to transfer control to.
arguments
The command-line arguments to be passed to the program.

Return Value:
The exit status of the program, or negative one (-1) if the program could not be executed.

Description:
Transfers control over to an external program. When the program exits, execution resumes immediately after the call to Exec.

Examples:
'A Windows based example but the same idea applies to Linux
Const exename = "NoSuchProgram.exe"
Const cmdline = "arg1 arg2 arg3"
Dim result As Integer
result = Exec( exename, cmdline )
If result = -1 Then
    Print "Error running "; exename
Else
    Print "Exit code:"; result
End If

Platform Differences:
Dialect Differences:
Differences from QB:
See also:
Back to Operating System Functions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode