I was working with text that consists of | (pipe,$chr(124)) delimited tokens. I made a stupid error and it's completely my fault, but the way mirc reported the error left something to be desired. Turns out mirc delays all "unknown command" error message for several seconds, making locating the origin extremely hard.
alias delayederror {
echo -s calling concatenate
var %dummy = $concatenate(AA,BB)
echo -s back from concatenate
echo %dummy
}
alias concatenate {
echo -s entered concatenate
; Next time try to remember pipe is a command separator...
var %retval = $1 $+ | $+ $2
echo -s leaving concatenate
return %retval
}
Running /delayederror produces:
calling concatenate
entered concatenate
leaving concatenate
back from concatenate
AA
-
BB Unknown command
-
Why is it like that? It doesn't even show the message immediately when the script finishes, it actually waits a good 3-5 seconds, during which there may be events that cause other scripts to run, so you can't even be sure which script is causing that error! Surely it would be much more helpfull to report the error when it happens:
calling concatenate
entered concatenate
-
BB Unknown command
-
leaving concatenate
back from concatenate
AA
Alternatively (or additionally) the message should also indicate the script & line of the error.
BB Unknown command in script.mirc line 125
alias simpler_example {
echo -s Entered
badcall
echo -s Left
}