Thomas
> >From an OOP perspective the problem is that they break encapsulation.
> >
>
> encapsulation!? the Obj you would create is as global as any PUBL var !?
If you knew what encapsulation meant (because your comment indicates that you clearly don't) you wouldn't even have to ask the question. It has nothing whatever to do with the scope of the object but everything to do with how an object manages its code and data.
Try this defintion:
Encapsulation is the hiding of data implementation by restricting access to accessors and mutators.or
In object technology, the creation of self-contained modules that contain both the data and the processing.or
In Object Oriented Programming, encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class. or
One of the primary advantages of using objects is that the object need not reveal all of its attributes and behaviors. In good O-O design (at least what is generally accepted as good), an object should only reveal the interfaces needed to interact with it. Details not pertinent to the use of the object should be hidden from other objects. This is called encapsulation.Get the idea?
By definition, Public Variables (by virtue of the fact that they hold data required and used by objects OUTSIDE of the objects) break encapsulation!
Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA