Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection_Access
Message
 
To
23/07/2003 16:43:46
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00812934
Message ID:
00813214
Views:
5
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform