How to exit app with a value?
BlitzMax Forums/BlitzMax Programming/How to exit app with a value?
| ||
Basically I want to create some small plugins (EXE's) that return an integer-value to their parent app when exiting. Should be possible with some WinAPI functions, but that'll kill cross platform. So is there something like "End(42)" ? Thanks Jake |
| ||
WriteStdout("42"+"~n")should do the trick. |
| ||
Damn, too easy ;) Thanks for the fast answer! Works like a charm. Another problem I got is that while running the process the cursor shows an hourglass no matter if I use SetPointer in the plugin or the parent app. EDIT: Seems like the Hourglass is magically gone when running the parentapp without IDE. |
| ||
@Dirk How does the main program receive the info? |
| ||
local subapp:TProcess=CreateProcess ("mysub.exe") 'Wait till app terminates while subapp.Status() 'could be while status()=0, not sure from memory wend 'get App return print subapp.pipe.ReadLine() The same way you can get output of subapp while running, just read from the pipe inside the loop. And please, don't call me Dirk ;))) |