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
Titre:
How to build upon objects returned from methods?
Divers
Thread ID:
00688002
Message ID:
00688002
Vues:
72
When dealing with Microsoft's Outlook application, I can do the following:

oApp = createobject("Outlook.Application")
oName = oApp.GetNameSpace("MAPI")
oFolder = oName.GetDefaultFolder(3) && Task Items

* This line is the one I'm interested in
oFolder.Items(1).subject = "This is a test"

Items() is a method of the Folder object. It returns an Item object and I can continue to reference the properties and methods of that object just by tacking on the .subject, etc.

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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform