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

Click here to load this message in the networking platform