I am creating a small script that is compatiable with multi channels and I am using setudef commands to set variables so I can give each channel its own variable via .chanset. I am trying to create a proc that when executed, it will delete certain array names (not entire array) and my question is how can I make it so the script find a certain value in array and return with array name so I can delete the array name.
ie.
set rchan($nick) $chan
I need $nick, but I only know $chan in this proc so I want to be able to find it and come back with $nick then delete it from there. Can it be done?
ppslim wrote:A simple "unset" of an array key, will result in memory not being freed unless the whole array is freed later.
This is false.
No matter what method you use to unset single elements from an array, memory will be freed, but the array itself will continue to exist and occupy the variable name in the interpreter.
As far as I know, 'array unset' with a pattern is the same as doing multiple calls to 'unset' (if the pattern matches more element names)
As usual, my explanations suck...hope you get the idea