Kelder, to improve my own coding... why would you use return instead of halt if you need to stop a script before the end? What advantage does that have? Is it more a matter of return being the official way, or is there some actual reason?
I would use RETURN over HALT as while it might not effect your script now, you may at some future date modify it to use a ^ event and the HALT command would then have unexpected effects.
and Here is something that I would have normally frowned on.
While if im writing real code, i well endever to have any procedure end by it running out of commands (ie: it reaches the end of the first { })
I think (opion here) that this is not the best option for mirc scripts, im sure they take more processing to get out of the event or alias becuase its interpreted at the time.
ie:
;I beleive this blah alias is better than the one below
alias blah {
if (x == y) {
... code ..
return
}
elseif (x == z) {
.. code ..
return
}
else { .. code .. }
}
;
; I dont think the below one is as good
;
alias blah {
if (x == y) {
... code ..
}
elseif (x == z) {
.. code ..
}
else { .. code .. }
}
I first noticed the difference in the xdccklipper check the text in channel alias it was using a GOTO of all things to get to the end of the alias (doing nothing else besides then exiting), so i replaced it with a RETURN and noticed some level of performance increase (this was on a very slow machine so, on a fast machine it would have been hard to gauage any difference)
I assume this is due to the rest of the alias having to be pharsed to find the goto and also even without it having a goto, is has to find the correct condinuing of code point, which then turns out to be a closing } and exiting of the alias.
* oh one other reason i dont use HALT is becuase I mostly write events in alias's something like this...
on ^*:TEXT:!blah:#:{ $blah($chan,$nick,$1-) }
alias -l blah { ...code... | if (some condition) { return HALT } | return }
This allows me to halt the event if i want, or not halt it. And it also allows me to test the alias without having to use a second nick, since i can just call $blah() myself using what ever test data i like, something i find most usefull for debuging.