Hi all,
in a PRG-Class you have the ability to add objects to a defined class by ADD OBJECT [PROTECTED] ObjName AS ObjClass etc. Exactly this I wanted to do, but my new object should be protected - so I used the PROTECTED keyword. All ok so far - BUT - if I return the added object to the caller of a method, all its properties and methods are protected too and this object is of no use ?! IMHO this smells like buggy behaviour, doesn't it ?
Just try :
SET PROCEDURE TO Test
o = CREATEOBJ('Test')
lo = o.GetProtectedObject()
? lo.Class
The class (Test.prg) :
DEFINE CLASS Test AS Custom
ADD OBJECT PROTECTED Test2 AS Custom
PROCEDURE GetProtectedObject AS Custom
RETURN m.this.Test2
ENDPROC
ENDDEFINE
Best Regards
Matthias