Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to build upon objects returned from methods?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
How to build upon objects returned from methods?
Miscellaneous
Thread ID:
00688002
Message ID:
00688002
Views:
73
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?
Next
Reply
Map
View

Click here to load this message in the networking platform