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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement