is it possible to create a proc which is called if an error occurs?
this procedure should also fix the error if possible.
the reason why i'm asking is because i made a script which kicks people if they enter different "bad words" - for example "^^"
all these words are listed in one list called bdkb_badwords
example: set bdkb_badwords "*^^* ^?^" and so on...
this procedure is working quite fine, but it has one big bug.
if someone enter "^^ (please note the ") the following error occurs:
Tcl error [bdkb_check_proc]: unmatched open quote in list
therefore i got the idea of doing some error correction. how could i create such a procedure that either trims the trailing " or puts another " at the end? i got no idea...
proc bdkb_check_proc { nick host hand chan text } {
global bdkb_badwords
set text [split $text]
# now you can check a text for "bad words" by using lsearch
# or looping this text (using for,while,foreach and lindex [ofcourse :)])
}