Archive: execwait - error flag


execwait - error flag
in documentation, I saw that an error flag is set if an error occurs. How can I get back this error (in a out file or another) ?
Thank you


ExecWait accepts another parameter which is the output variable for the return code of the program. If you use it you will get the return value in it instead of the error flag being set. In this case the error flag will only be set if the process has failed to create (bad path, not an executable, etc.).


How can I get back a file with reporting of an error if an error occurs with execwait ? because in window Show Details I don't see that the process (asked by execwait) makes an error, I just see that the process is executed.
Thanks


Do you want something to be printed if an error occurs? That depends on the program you are running. You should know if it failed or not according to its return value (get it as described above). If you know it has failed you can print a message using DetailPrint or even print and abort using Abort.


I would like to create a file containing that an error occured if the program that I launch makes an error. I don't kown in advance if the program will fail or not.
I tried to use IfErrors and create a file but apparently the error flag is not set.


Does it return the same value if there was an error and if there wasn't an error (check using ExecWait using the above method)? If so, there is nothing you can do unless you know of any other way to tell if the program has failed.

If it outputs something to the console you can use nsExec to get the output and parse it. The output might contain what you're looking for. Try it in case the return value is always the same.


It doesn't return some value. It just updates some files from a database e.g. or another program.
It doesn't put nothing in console.
So there nothing to known if the execution of this process had success or failed ?


According to what you've said up until now there is no way of telling if it failed or not. Try from this direction - how do you know it failed? Try to implement that in the script.