To my knowledge, you can't destroy or create a global variable in proccess(that is, by clicking on a button or something). However, my question to you is, Why would you want to? Tim
Remember the KISS principle:
Keep It Simple, Stupid!
- Tim
It is a variable that will be used infrequently and it is a matter of style that I don't like to leave useless variables hanging around out there with infinite life. I know it's not critical and with the amount of resources used it's immaterial. Just trying to perfect my knowledge of VB.
- John
Thanks for the suggestion. However, I will probably just not worry about the space used.
Rich:
Sounds to me like these seldom used variables should not be declared as Public(Global) in the first place. It is good programming practice to AVOID using Public variables.
Try declaring a seldom used variable as a LOCAL variable in a routine, and if you need to, pass that variable to the routine that needs it.
Sometimes you just need that Public variable in place, even though your program might never use it during a run.
As a quick example of where you might need one:
Public booCancel As Boolean
Private Sub cmdCancel_Click()
booCancel = True
End Sub
Private Sub DoWork()
Do While Not booCancel
DoEvents
'do work
Loop
End Sub
Tim
Remember the KISS principle:
Keep It Simple, Stupid!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.