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
Miscellaneous
Thread ID:
00688002
Message ID:
00688075
Views:
29
Rodd,

Did you check the code example I sent you? I do exactly what you are doing and it works.

e.g. loMessageCollection.Items[1].ChildCount works for me.


>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?
- Jayesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform