egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

remove proc

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Ofloo
Owner


Joined: 13 May 2003
Posts: 953
Location: Belguim

PostPosted: Wed Jan 28, 2009 6:45 am    Post subject: remove proc Reply with quote

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
View user's profile Send private message Visit poster's website
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Wed Jan 28, 2009 10:08 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Jan 28, 2009 10:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber