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?
g-spotAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Yes, it can:

Public Function ComputePrices() As Decimal()

End Function

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
g-spotAuthor Commented:
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?
0
Bob LearnedCommented:
If a single ticket has multiple prices, then yes you could do it that way.

Bob
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

g-spotAuthor Commented:
Thanks again.

You dont happen to teach VB/OOP do you? I think I need to go to VB school. ;-)
0
Bob LearnedCommented:
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
0
g-spotAuthor Commented:
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).
0
Bob LearnedCommented:
Well, I have been programming for 20+ years, and the learning curve wasn't quite as steep for me.

Bob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.