Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this intended Behaviour ?
Message
De
03/12/2003 05:35:43
 
 
À
03/12/2003 04:37:37
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00855319
Message ID:
00855330
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform