| |
|
| `Kazuma - Tue Jan 31, 2006 9:22 am |
|
|
One of the biggest mistakes beginning scripters make is assuming that you MUST have an 'else' statement, or that you have to 'goto' to get to your commands. Commonly seen in scripts-
In most cases, the 'else' section can be completely removed. Or another example, using goto:
Instead of using gotos like this, just stick the code in the ifs:
A final example of an if that doesn't need a goto:
This assumes that ':end' is a label at the end of the routine. Instead, just use 'return'- it will end the current alias or remote, without halting any default behaviors or other scripts. (same end effect.)
 |
|
|
|
| Acid-Religion - Sat May 20, 2006 6:04 pm |
|
|
Quite right. Using the else halt command can really mess up things.. And if you on top of that use On *:text:*:*: it will really mess things up...
I usually refrain from using halt altogether as experience shows that I do not need it at all (mostly)..  |
|
|
|
| Mylesmart - Sat May 05, 2007 1:09 pm |
|
|
| yes, i agree with acid. |
|
|
|
| CakerX - Fri May 11, 2007 2:25 pm |
|
|
don't use halt unless you want to stop EVERYTHING.
return works best, use /return $null |
|
|
|