Hi there!
I call a function (called runFile) in my code that an external library provides me for running external scripts from file. I succesfully call any script I want to run, but the problem is that I don't know how to detect when the script I run is aborted by the user. I suppose it's done with the exception the API describes, but I don't know how to detect it. The description of the function in the library is the following:
String runFile (String sScriptPath)
Description: Run script from file(s)
Parameters: sScriptPath file name which is either full path, wildcard mask or just base name, in this case the file issearched in current directory or using ucam.db key.
Returns: String RUN_STATUS_OK if run is OK, otherwise returns message about issue encountered.
Exceptions: AbortException if any problem encountered during script call
And that's my code:
RunFileReturn = runFile("C:\\macros\\ucammacros\\Blocs.vhs"); if(!isEqual(RunFileReturn,"OK")) { promptStart(); promptLabel(""); promptLabel("Hi ha hagut un error al repassar els pads als blocs."); promptLabel(""); promptLabel("Aborta i recupera el circuit des de l'últim checkpoint."); promptEnd(); }
The thing is that I correctly run "Blocs.vhs", but if I abort "Blocs.vhs" manually during it's execution, runFile still returns me "OK". Probably it only doesn't return "OK" in case it cannot find "Blocs.vhs" file, but I would like to know when the user aborts during "blocs.vhs".
Could anyone tell me how can I do that? Is the exception described above what detects an abortion? Then, how can I use it?
Thanks and sorry for my english!