mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 17
KyD Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 17
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.

Joined: Oct 2003
Posts: 101
Vogon poet
Offline
Vogon poet
Joined: Oct 2003
Posts: 101
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.


Link Copied to Clipboard