Reputation: 931
I'm launching a DOS program using Runprogram wait "command plus args"
which exits with 1 whenever an error happens and 0 when everything works as expected...
Problem is, I'm unable to catch that exit code.
Chain Wait
without any positive result.I'm using VDF 18.2 my App is a desktop app.
Upvotes: 0
Views: 227
Reputation: 931
I finally found the answer which is working like a charm. Seems to be that DataFlex has this "magic variable" called strmark
which is cleaned and filled everytime I issue the command Runprogram Wait ('program') ('args')
.
So at the end of the day we can do something like this:
Runprogram Wait ('program.exe') ('my args')
If strmark Showln ('Well, we have an error my friend... Exit code: ' + strmark )
Else ...
This works like a charm when the program itself has a problem or even if the user closes the Command prompt window.
Upvotes: 0