Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to build upon objects returned from methods?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00688002
Message ID:
00688028
Vues:
25
This message has been marked as the solution to the initial question of the thread.
Hi Rodd,

>I've built a very similar class structure ... one in which an "collection" object has an items() method that returns the object that it stores; but I'm not able to access the properties and methods of the returned object in the above manner. Instead, I'm forced to do this:
>
>oItem = oFolder.Items(1)
>oItem.subject = "This is a test"
>
>What can I do to my classes to enable the kind of "inline" syntax that I am able to use with the Outlook object?

- Add a property called oItem[1] to your class.

- Add an oItem_Access method
- In the access method your receiving the array index as a parameter
- Use this value to find the object reference you want and return it

- or -

- simply store your item references in the oItem property array

HTH,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform