ppslim wrote:This does have it's added advantages, however, you can disable this inside one proc, without haveing to use the filt proc.
There is a global variable called $lastbind, which you can use to see how the command was called.
This will allow a single procedure, to act for multiple commands. In any help information, you can use it, to output the command name used, rather than a fixed one.
See more information in tcl-commands.doc
Ofcourse, for this to work, you would still need multiple bindings, such as:
Code: Select all
bind dcc n te proc_to_call
bind dcc n tes proc_to_call
...
bind dcc n testcha proc_to_call
bind dcc n testchan proc_to_call
Otherwise, $lastbind would contain the value of the nearest-matched command of course. (ie. doing .testc [without the additional bindings in place] will set lastbind to "testchan")
This method itself alone is very inefficient as stated before,
not to mention that it too will have problems if there are other commands
that start with "te", etc.. which would have to be dealt with some how as well.. You may have 2 procedures using filt, but less lines taken by excessive bindings if you were to utilize $lastbind... Overall, you'd save time and space by filt'ing, if you really must worry about it at all.