即时通讯启动一个DOS程序使用运行程序Runprogram wait "command plus args"这将退出1每当一个错误发生,0当一切正常工作Runprogram wait "command plus args" ...
问题是,我无法捕捉到退出代码。
我已经尝试使用ShellExecuteA但dataflex不会等待它关闭... 我也尝试过使用Chain Wait但没有任何结果。我使用VDF 18.2我的应用程序是一个桌面应用程序。
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.
最满意答案
我终于找到了像魅力一样工作的答案。 似乎是DataFlex有这个叫做strmark “魔术变量”,每次我发出Runprogram Wait ('program') ('args')命令时Runprogram Wait ('program') ('args')清理并填充这个变量。
因此,在一天结束时,我们可以做这样的事情:
Runprogram Wait ('program.exe') ('my args') If strmark Showln ('Well, we have an error my friend... Exit code: ' + strmark ) Else ...当程序本身出现问题时,或者即使用户关闭了命令提示符窗口,这也可以起到一定的作用。
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.
更多推荐
发布评论