Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Arguments

...

1TypeNameComment
2INTEGERresultStringxpxP_WAITxpxP_NOWAIT or xpxP_NOWAITO are the available legal valuesmode
  1. XPX_P_WAIT          : This is a synchronous call to the given process
  2. XPX_P_NOWAIT     : asynchronous calls
  3. XPX_P_NOWAITO  : asynchronous calls

In addition to these, there are two more option that are not available directly to the user, but can be used through their direct integer code.

  • _P_OVERLAY  --> integer code = 2 -->   Overlays a calling process with a new process, destroying the calling process (same effect as _exec calls).
  • _P_DETACH     --> integer code = 4 -->  Continues to execute the calling process; the new process is run in the background with no access to the console or keyboard. Calls to _cwait against the new process fail (asynchronous _spawn).
3STRINGexecutableNamethe name of the program or ".exe" file to be started.
4SET OF STRINGcommandLineArgumentsa set of strings that specifies the "command line arguments" to the actual program to be started. This argument may be INDETERMINATE.
5SET OF STRINGenvironmentVariablesa set of strings that specifies the environment variables to be defined for the actual program to be started. This argument may be INDETERMINATE
6INTEGERexitStatusreceives the "exit status" from the actual started program. This argument may be INDETERMINATE.

...

Insert excerpt
US:_r_XPX_Return_Value
US:_r_XPX_Return_Value
nopaneltrue

Options

...

...

 

Example

...

Code Block
languagecpp
<Missing Example>LOCAL
      case_name            : STRING := 'Case 01, testing xpxSpawnProcess';
      case_no              : INTEGER := 1;
      ok                   : LOGICAL := TRUE;
      mode                 : INTEGER;
      executableName       : STRING;
      commandLineArguments : SET OF STRING;
      environmentVariables : SET OF STRING;
      exitStatus           : INTEGER;
      rstat                : INTEGER;
    END_LOCAL;
 
    -- -----------------------------
    --  1a. Testing xpxSpawnProcess.
    -- -----------------------------
    trace(case_no, '1a. Testing xpxSpawnProcess');
    mode := XPX_P_WAIT;
 
    executableName := 'X:/terje/testParams.exe';
    commandLineArguments[0] := 'one';
    commandLineArguments[1] := 'two';
    commandLineArguments[2] := 'three';
    environmentVariables[0] := 'PATH=X:\terje';
 
    rstat := xpxSpawnProcess(mode, executableName, commandLineArguments, environmentVariables, exitStatus);
    trace_error(::CL::, rstat, ok);
    ok := CheckValueExists(exitStatus, ::CL::) AND ok;
    ok := (exitStatus = 0) AND ok;
    xpxPrintf('* exitStatus = %d\n', exitStatus);





 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "extension_schema" and parent = "5636522"

...