Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this intended Behaviour ?
Message
From
03/12/2003 05:35:43
 
 
To
03/12/2003 04:37:37
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00855319
Message ID:
00855330
Views:
10
Matthias

This does look like a bug and a very odd piece of functionality, the help states that all properties will become protected, not methods too, I also don't like the sound of it either.

I would stick to creating a protected property first then adding the object by CREATEOBJECT, you'll be safer this way.

Either way, it's a bug, as like you said, the class is completely useless.

Kev

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform