Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error : Illegal redefinition of variable
Message
From
24/07/2013 09:36:52
 
 
To
24/07/2013 09:28:16
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01579124
Message ID:
01579143
Views:
37
>>>>PUBLIC oldproduct, oldrinward, sale2edit, sale2add, zuretval, oareacode, oareaname, osmancode, osmanname, oaccode, oacname, ocompcode
>>>Dont use Public!
>>>And if you cannot avoid
>>>than dont use them
>>There is NOTHING wrong with using PUBLIC, Koen. There are probably better ways to code than using
>>PUBLIC, but it is perfectly legal and will work correctly, and in some cases is the only way to accomplish
>>something.
>
>There is little BENEFIT to PUBLIC. By avoiding it, programmers will learn the better ways to code.


Such a comment conveys a lot of assumptions. It also negates the fact that there are dozens of scenarios where PUBLIC is not only desirable, but the most efficient solution. There are always other ways to code things, but sometimes simpler is better. Each component has its place, and learning the conditions surrounding when to use each is what makes a programmer learn better ways to code.

FWIW, Visual FreePro adds the concept of "thread globals" which are public definitions visible only to the current thread, called TPUBLIC or TGLOBAL.

The right tool for the right job. Right? Sometimes PUBLIC is most desirable, and my response to Koen was to his comment "don't use public," which I do not believe is good advice as it immediately shuts people off to the idea of ever using a PUBLIC definition, when using PUBLIC definitely has its place.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform