Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this intended Behaviour ?
Message
From
03/12/2003 04:37:37
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Germany
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Is this intended Behaviour ?
Miscellaneous
Thread ID:
00855319
Message ID:
00855319
Views:
54
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
Next
Reply
Map
View

Click here to load this message in the networking platform