I think it would be nice if there were an /error command so that we can create our own error messages in aliases, which can be handled in the calling script using normal error handling (:error, $error, and /reseterror), or spit out an error message to the active window, like any command/$identifier with invalid parameters. Also, /error should halt/return the alias it is used in. For example:

Code:
alias test1 {
  test2 1
  halt
  :error
  echo -a $error
  reseterror
}
alias test2 {
  if ($1 != 2) error parameter must be 2
  echo -a we never get here, because /error halts.
}


The "* aliasname:" and "(line N, script.mrc)" of the line where the erring alias is called, where applicable, would be added by mIRC, so that the /error command in the previous example will create a $error like:

* /test2: parameter must be 2 (line 2, script.mrc)

If no error handling is used by the scripts, or the command is used at the command line, it should be echo'd out as a normal error message for a built-in command would be.

I'm hoping against all hope that all of the above semi-sleep-deprived ramblings made sense..


edit: Also, mIRC would need to prefix the alias name in $error with / or $, depending on how it is used in the script that calls said alias.

Last edited by Hrung; 30/05/05 08:59 AM.