mIRC Homepage
Posted By: KyD strange behaviour with :error - 13/08/04 10:48 PM
examine the following code:
Code:
goto $1
when there is no label called $1, an error is thrown, this error can be caught by including an :error label, so far so good.

now there a two things that strike me as odd here:
- the error is only caught if there is no label after the :error label in the current scope
- when an :error label is present and there is no label following it, no error is thrown, however, the script does not jump to the :error label. in fact it jumps to the first label (the $error is still set though).

the helpfile states "When an error occurs, the script will jump to :error and continue running.". so these are either bugs, or the helpfile is wrong.

using mirc v6.16.
Posted By: root66 Re: strange behaviour with :error - 14/08/04 08:35 PM
Agreed. I have presented this several times in #mirc to people who claim to have :error working for them, and I ended up scrapping it for its unreliability and resorting to a ton of elseif's.

Really this boils down to a need for scoping variables. I honestly don't see a reason why this has not been added yet. a scope or "case select" type statement would be a vast improvement.
© mIRC Discussion Forums