>Jim,
>
>>
This si a violation of the basic programming principle of encapsulation, that is any routing should have everything it needs within it self or receive those things as parameters.>
>Ok. What to say about that suggested by other fellows in creating a global object and setting its properties, to play the role of public vars?
Fernando,
Youn are making the common error of thinking that PUBLIC vars are the same thing as Global vars, they are not the same. Global var can bee seen and manipulated anywhere within the system, a public var outlives the routine that creates it. These are NOT the same thing. A private variable declared in the top level of a system is Global to that system.
Using an object to hold the global values is an OOP way of doing the same thing. The ref to the global object does NOT need to be a pubic var though. A private var created in the start up program for the system will accomplish the creation of a global var holding the ref to the object.
The issue folks are cautioning you about is NOT global vars, it is VFP Public vars.