Reset?
Hi all,
In my program i am using alot of variables, once 1 process finshes i am having to ask the user to re-strat the application simply to make sure all variables have been cleared.
Is it possible to refresh the program back to its original state when it was initially started, without having to actually shut it down and re-start it?
[354 byte] By [
mp_direct] at [2007-11-11 7:14:42]

# 2 Re: Reset?
My two cents:
resetting variables is dangerous: there can be too many of them, and it is easy in a future develeopment to add another one and just forget to clear it.
The best way is to incapsulate logic and variables in one (or more) class module (this is what classes are for). Destroying and creating a new class will reset everything (including allocated memory) and gives you "fresh ground" to start with.
If the "damage" is already done and all your code is in a form, just unload that form and create a new one (not elegant, but safer than trying to reset everything). If the code is in a bas module, just move it into a class.
Marco
mstraf at 2007-11-11 17:28:16 >
