Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variables not releasing
Message
From
03/01/2000 10:00:32
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00311218
Message ID:
00311661
Views:
53
>Great - I've got to share my dirty little secret with the world.
>I'm new to VFP and my only app is converting my FPD app to visual. The learning curve is steep when you don't do this for a living.
>I'm filling arrays with fields from tables and using them in combos. The only way I can get it to work is (do I have to admit this) to initialize them in the load event as Public variables.
>I'm attending weekly meetings of Variables Anonymous but have a way to go.

Ken,
Welcome to VFP!
One of the many reasons public variables are a problem is that they are hard to clear. RELEASE ALL in a program does not release PUBLIC variables. So, while you are learning the better ways to handle your variables, you can release the PUBLIC variables individually. For example, if in your LOAD you have PUBLIC cMyVar, cYourVar, cOurVar Then in your cleanup you will need RELEASE cMyVar, cYourVar, cOurVar .
I suggest you continue with Variables Anonymous, but if you can't go cold turkey, then be very careful while you still have PUBLIC variables, because they can cause problems in other parts of your program if you don't watch out.

David.
David.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform