mIRC Homepage
Posted By: darkrift on *:merror - 21/04/05 06:01 PM
do you think it would be a good idea to creat an event to capture mIRC command error and create a command that will allow to capture them when we build our own commands

for example to caatch those error:

* /write: unable to open 'C:\Program Files\mIRCtest\c~o~g~i~t~o~b~o~t\'C%1%%2%Program\create~Files%2%mIRCtest%2%c~o~g~i~t~o~b~o~t%2%--------------------'.txt' (line 50, brain.CGB)

* /set: line too long (line 67, brain.CGB)

and creating an error command like /error /cmdname: error parameter

or maybe it already exists and I don't know what it is ..
Posted By: DaveC Re: on *:merror - 21/04/05 06:13 PM
cant u just trap that with the standard error trapping?
Posted By: tidy_trax Re: on *:merror - 21/04/05 06:22 PM
There is error handling support already, although it would be very nice to be able to capture and handle errors at a global scale so I support your suggestion. smile

Btw, the current way to handle errors is like this:

Code:
alias test {
  ; Try to execute a command that doesn't exist.
  nonexistantcommand
  ; Make sure the code beyond the error label isn't executed normally.
  return
  ; Error label (This is where mIRC jumps to if it encounters an error)
  :error
  ; Try to fix the error, or in this case just echo it.
  echo -a Error! $error
  ; Hide the default display.
  reseterror
}
© mIRC Discussion Forums