mIRC Homepage
Posted By: NaquadaServ /throwerror for use with :error - 16/04/07 01:50 PM
Although I brought up the idea here, I think the suggestion is good enough that it needs it's own thread...

I would like to see a /throwerror command that generates an error that propogrates back to a calling alias and sets $error to whatever is specified for arguments to /throwerror

In addition, an $errorsource identifer that reports the name of the alias throwing the error.

Code:
alias {
  dothis
  goto end
  :error
  echo -s $errorsource threw the error message: $error
  :end
}
alias dothis
  if ($1 == $null) /throwerror No arguments specified
  ; using /throwerror will also stop handling the alias
  echo -s only got here if $ $+ 1 is specified
}
Posted By: NaquadaServ Re: /throwerror for use with :error - 18/04/07 07:27 PM
Replace "alias dothis" with "alias dothis {"

Perhaps $errorline would be more useful then $errorsource, both would be cool though. smile

I really hope this will be added to mIRC. I could use it to trace a clear path an error took.

For example,
Code:
alias a {
  return $b
  :error
  echo -s error: $error ( $+ $script $+ , Line $errorline $+ )
  ; In this example it would echo
  ; error: $b : $c : Some Error (ScriptName, Line 2)
}
alias b {
  return $c
  :error
  ; $errorline here would equal 9
  /throwerror $ $+ b : $error
}
alias c {
  /throwerror $ $+ c : Some Error
}
Posted By: Spitfire3292 Re: /throwerror for use with :error - 19/04/07 03:52 AM
Waita use that edit button :p

Anyway, this isn't a bad idea at all. This way the error that occurs can be found much for quickly.

I like this more than my error debug method of going through and echoing everything until i find the problem smile
Posted By: RoCk Re: /throwerror for use with :error - 19/04/07 12:22 PM
Quote:
Waita use that edit button


Notice his reply was 2 days later, I think edit is only available for 2 hours.
© mIRC Discussion Forums