0

Im launching a DOS program using Runprogram wait "command plus args" wich exits with 1 whenever an error happends and 0 when everything works as expected...

Problem is, I'm unable to catch that exit code.

  • I have tryed using ShellExecuteA but dataflex wont wait for it to close...
  • I have also tryed to use Chain Wait without any possitive result.

I'm using VDF 18.2 my App is a desktop app.

Solrac
  • 924
  • 8
  • 23

1 Answers1

0

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.

Solrac
  • 924
  • 8
  • 23