Any way to simulate Try and Catch behaviours? - Forum

Forum Navigation
You need to log in to create posts and topics.

Any way to simulate Try and Catch behaviours?

So I've made a function where it's quite common for commands to call something that is not available (where it usually goes like Action references a label that does not exist), but since its a function, after one error, it just breaks and exits the entire function and returns to the main code that called the function initially. (I can catch an error if I put an Ifex "[lasterror]<>[null]" right after the initial "call" line.)

.// There is high possibility that the [Currentline_Ins] value can't be found.
Gotoline "Command:[Currentline_Ins]"
If "[LastError]" "<>" "[null]"
   .// Do something else
Endif

I need to do something else if the [lasterror] contains something but since it just exits the whole function I can't even try to do anything. Is there any way to not let it breaks the function? and make it just executes one more line in the function? Or a way to say try this and if there's an error, then do this? (I know I can use Ifex to solve it but is there another way using [lasterror] variable?)

It's weird because it just happens in the compiled version, While in design mode it executes other commands and doesn't break the function.