?
Solved

Can a function return an array?

Posted on 2006-03-28
7
Medium Priority
?
158 Views
Last Modified: 2010-04-24
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?
0
Comment
Question by:g-spot
  • 4
  • 3
7 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 16311772
Yes, it can:

Public Function ComputePrices() As Decimal()

End Function

Bob
0
 

Author Comment

by:g-spot
ID: 16311832
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16311858
If a single ticket has multiple prices, then yes you could do it that way.

Bob
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:g-spot
ID: 16311895
Thanks again.

You dont happen to teach VB/OOP do you? I think I need to go to VB school. ;-)
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16311916
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
 

Author Comment

by:g-spot
ID: 16311984
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16312004
Well, I have been programming for 20+ years, and the learning curve wasn't quite as steep for me.

Bob
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question