Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection_Access
Message
 
À
23/07/2003 16:43:46
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00812934
Message ID:
00813214
Vues:
6
Matthias,

I know there is something wrong when you assign a collection to a existing property but with ADDOBJECT it run's ok
In your sample

? o.Test(1) && is ok !

Marcel

>Hi all,
>
>I just wonder about Access methods for collection objects. I want to be able to access a collection-object determined by an access-method in the same way as I usually do with "static" collections. But it seems as if Object.Collection(1) doesn't work - while Object.Collection.Item(1) does ... This makes working with dynamic collections pretty hard as access-methods are intended to hide this process of choosing the right object.
>Anyone an idea how to get around this ?
>
>TIA
>Matthias
>
>The code :
>
>o = createobject('Test')
>o.Test.Add(CREATEOBJECT('Custom'))
>? o.oTest(1) && fails
>? o.oTest.Item(1) && ok
>
>DEFINE CLASS test AS Custom
> oTest = .NULL.
> ADD OBJECT Test AS Test2
>
> PROTECTED PROCEDURE oTest_Access AS Object
>
> this.oTest = this.Test
> RETURN this.oTest
>
> ENDPROC
>
>ENDDEFINE
>
>DEFINE CLASS Test2 AS Collection
>ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform