| View previous topic :: View next topic |
| Author |
Message |
Ofloo Owner
Joined: 13 May 2003 Posts: 953 Location: Belguim
|
Posted: Wed Jan 28, 2009 6:45 am Post subject: remove proc |
|
|
hi, i'm wondering if it would be possible to delete a proc without restarting your script..
like..
| Code: | | proc test {} {return 0} ;# proc is created now how to delete it? |
I've been thinking of a way to do this but I can't think of any, is it even possible, .. _________________ XplaiN but think of me as stupid |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Wed Jan 28, 2009 10:08 am Post subject: |
|
|
I don't know of any way to 'unset' a proc but you could simply overwrite it with a proc of the same name accepting the same number of arguments that simply returns zero (ie. does nothing). Not exactly elegant, but functional in most circumstances I would have thought.
The only problems i envisage is if you use the command [info procs ?pattern?] elsewhere in your code because the proc would still exist, or perhaps if you are deliberately trying to generate and catch an error if the proc doesn't exist. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Jan 28, 2009 10:36 am Post subject: |
|
|
Simply use the rename command. Renaming a proc to an empty string will delete the function and/or proc. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|