简体   繁体   中英

VISUAL DATAFLEX How can I get the exit code of Runprogram

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM