oi10:presentation_server:exitcode_property_system

EXITCODE property (System)

Returns the exit code of the last process that was executed by the RUNWIN method.

This property is a numeric value. When a process exits it normally returns a value to indicate the status of the program when it closed. By convention a successful execution returns an exit code of 0, but this is not enforced.

DevelopmentRuntimeIndexedScaledSynthetic
N/AGetNoNoNo

When executing a process with RUNWIN in an asynchronous fashion this property is only valid when accessed from the specified callback routine.

If several asynchronous tasks are executed in a simultaneous fashion then the valid of the EXITCODE property may not be accurate when accessed in the callback – as it is a global property it may be overwritten by a different, subsequent process exit before the callback can be executed.

 
// Execute an asynchronous process with a callback stored procedure defined.
CmdLine = "c:\devtools\myproc.exe /D=34 /A=Wibble"
CmdArgs = ""
CmdArgs<1> = 1                    ; // Show Normal, Async
CmdArgs<2> = "MY_CALLBACK_PROC"   ; // Stored Proc to call on exit
CndArgs<3> = "myproc"             ; // Argument to pass to proc
CmdArgs<4> = Drive()              ; // Working Directory
Call Exec_Method( "SYSTEM", "RUNWIN", CmdLine, CmdArgs )
// ================================================================= //


// ================================================================= //
// Example stored callback proc
Compile Subroutine MY_CALLBACK_PROC( CallBackArg )
      If ( CallBackArg == //"myproc" ) Then
         // We got a callback fom "myproc.exe" - Get it's EXITCODE
         //                   and log it
         ExitCode = Get_Property( "SYSTEM", "EXITCODE" )
         Call UpdateLog( "MyProc.exe returned " : ExitCode )
      End
   Return
 

RUNWIN method.

  • oi10/presentation_server/exitcode_property_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1