[英]VISUAL DATAFLEX How can I get the exit code of Runprogram
我使用Runprogram wait "command plus args"
啟動DOS程序, Runprogram wait "command plus args"
並在錯誤發生時以1退出,而在一切正常時以0退出...
問題是,我無法捕獲該退出代碼。
Chain Wait
而沒有任何積極的結果。 我正在使用VDF 18.2,我的應用程序是桌面應用程序。
我終於找到了像魅力一樣有效的答案。 似乎是DataFlex具有稱為strmark
“魔術變量”,每次我發出命令Runprogram Wait ('program') ('args')
,都會清理並填充該變量。
因此,在一天結束時,我們可以執行以下操作:
Runprogram Wait ('program.exe') ('my args')
If strmark Showln ('Well, we have an error my friend... Exit code: ' + strmark )
Else ...
當程序本身有問題時,或者即使用戶關閉了命令提示符窗口,這也一樣起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.