Link to home
Start Free TrialLog in
Avatar of g-spot
g-spot

asked on

Can a function return an array?

This question leads from other questions I have asked here with regard to OOP design patterns.

If I have a "quote" class that provides a quote with prices dependant on different factors how can i call a function that would return three different prices. For example say I want to call my function that will provide quote prices for:

Vacation (Bed & Breakfast)
Vacation (Half Board)
Vacation (Full Board)

Is it possible to call the function then the function return the array of prices?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of g-spot
g-spot

ASKER

Hi Bob

Thanks again. Taking this back to my earlier question regarding objects and collections. Would I create a Price object and a prices collection that contained the various prices. This price collection would then become part of my ticket object?
If a single ticket has multiple prices, then yes you could do it that way.

Bob
Avatar of g-spot

ASKER

Thanks again.

You dont happen to teach VB/OOP do you? I think I need to go to VB school. ;-)
Since true object-oriented programming hasn't been available until VB.NET, it has been a learning experience for me, too.  If you had background in C++, then object-oriented programming was a simple transition--but, I didn't have much experience with C++.

Bob
Avatar of g-spot

ASKER

Since I only started programming anything about 9 months ago this is all a big learning experience for me. But I'm enjoying it (I think).
Well, I have been programming for 20+ years, and the learning curve wasn't quite as steep for me.

Bob