DEFINE CLASS objectGet as Custom OLEPUBLIC PROTECTED AccessCnt AccessCnt = 0 ListArray = 100 PROCEDURE ListArray_ACCESS && Access method THIS.AccessCnt = THIS.AccessCnt + 1 RETURN THIS.ListArray ENDPROC PROCEDURE ListArray_ASSIGN && Assign method LPARAMETERS tAssign && Required to accept value THIS.ListArray = tAssign ENDPROC FUNCTION GetCnt RETURN THIS.AccessCnt ENDFUNCTION ENDDEFINEThen this code would yield the following results:
oGet = CREATEOBJECT ("objectGet") ? oGet.ListArray && Display 100 oGet.ListArray = 50 ? oGet.ListArray && Display 50 ? oGet.GetCnt () && Display 2Also note the use of AccessCnt. It shows an alternate way of accessing a private property via an accessor method. This is probably what you had in mind at the first place. I prefer the preceding method though, because it is more self-documenting - I know just by reading the code that _ACCESS and _ASSIGN methods are accessors for a local property while forcing the caller to pass by my accessor to get what they want.