|
Posted by Rik on 05/27/06 05:50
dimo414 wrote:
> I have a script which needs to reset a series of variables several
> times; I have a function setallvar() which first obtains all these
> global variables, then sets them all. It's quite a tedious setup, but
> quite useful to be able to basically unset them all like this. You
> said this is poor form, what would you suggest instead, to mass-set
> variables?
I'no real OO fan, but maybe that's a good answer is this case: create an
object with certain vars, with corresponding functions, and further on
create another object with different vars.
Then again, I'm used to initializing vars. Every variable which is used I
initiliaze somewhere in the script, prior to setting/using it. No chance it
has a wrong value, and an extra security measure, usefull for instace when,
heaven forbid, I'm working on a server with register_globals.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|