Jordan,
You can do this using the PROTECTED keyword:
DEFINE CLASS objectGet as Custom OLEPUBLIC
PROTECTED ListArray
ListArray = 0
Procedure getValues
return THIS.ListArray
EndProc
ENDDEFINE
When a property is configured as protected, you can only access from within the class itself. If you create an object reference to ObjectGet and attempt to access the ListArray property directly using ObjectGet.ListArray, VFP will throw an error saying the property does not exist.
The difference between this method and the one Sylvain posted is that you can access ListArray from outside the class if you have an _Access method. All accesses (internal/external) to the property are directed through the _Access. To tell the difference, you would need to parse up the call stack to determine if an internal method was accessing it.
HTH.
>Hi all,
>how do i create a private property in a class? is this correct?
>
>
>DEFINE CLASS objectGet as Custom OLEPUBLIC
>
>private ListArray
>
>Procedure getValues
> ** retrieves values from the ListArray
>
>EndProc
>
>ENDDEFINE
>
>what i want to happen is the class has the ListArray as a property, but can't be accessed directly, instead it is to be accessed through the getValues procedure. Am i on the right track?
>thanks
>Jordan
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao