Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where is the best place to declare public variables?
Message
 
To
24/08/2000 15:12:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00408953
Message ID:
00409021
Views:
23
I do not use public variables. I found it a good practice to avoid public variables with the introduction of Visual FoxPro 3.0, as you might re use them in some point of your program and give them a diferent data type or value and receive an unexpected result.

About two years ago I was given a VFP application that was created by another programmer. The client was complaining about "incorrect values" and the president of the consulting company gave the project to me to fix. This was an application for the Nuclear Energy Industry, and had critical values. The problem turned out to be 56 global variables were used. Objects were created and subclassed. Values of global variables which were declared in the main.prg were changed inside of parent objects and gave interesting results.

I have been paid well when I have had to correct another programmers mistakes.

Tom
Previous
Reply
Map
View

Click here to load this message in the networking platform