Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussions

retrieving the exit code of a process run via SYSTEMQQ

forall
Beginner
643 Views
Hello,

Is it possible to retrieve its exit code when calling an EXE file via SYSTEMQQ?

I have tried GETLASTERROR, GETLASTERRORQQ etc to no avail.

I realise this is given by the return value of the SYSTEM() call, but for completeness wanted to implement such checks for my use of SYSTEMQQ as well.

Or am I mis-understanding something basic about what SYSTEMQQ does?

thanks in advance,
dmitri
0 Kudos
2 Replies
Steven_L_Intel1
Employee
643 Views
SYSTEMQQ does not provide you a way to get the exit status. GETLASTERROR would not help here.
0 Kudos
anthonyrichards
New Contributor III
643 Views
Where exactly do you expect the .EXE to send its 'exit code'?
If it is indeed stand alone (not accessing one of your DLLs that is also accessed by your calling program, where otherwise the .EXE and your program could use a global flag held in the DLL for communication purposes), then the .EXE must write it to a file, which your program could then open and read.

You could turn your .EXE into a library function or routine called by a simple Thread function that you include in the library. You can then use CreatThread to send a value to the thread function that runs the .EXE's code and receive back from it a terminating value when the created thread exits.
0 Kudos
Reply