You use :error to catch an error, once :error is reached after an error occured, you either use /reseterror to recover from the 'error state' and continue with the processing of the script, or you don't, and you use /return to propagate the error back to the previous function. That's the two use there are, if you don't use /reseterror and you don't use /return to propagate the error back, mIRC stays in an error state and, even though it seems it can keep going with processing the script, it won't do it properly, and this is exepected.
Here are the different possibilities:
1) Recovering
alias A {
B
echo -a A finished
}
alias B {
echo -a %variable
:error
if ($error) {
echo -a An error occured: $v1
reseterror
}
echo -a B finished
}
2) Recovering from the previous function
alias A {
B
:error
if ($error) {
echo -a An error occured: $v1
reseterror
}
echo -a A finished
}
alias B {
echo -a %variable
echo -a B finished
}
3) Recovering from the previous function with the actual function being 'aware' an error occured
alias A {
B
:error
if ($error) {
echo -a An error occured: $v1
reseterror
}
echo -a A finished
}
alias B {
echo -a %variable
:error
if ($error) return
echo -a B finished
}
}