Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort array of structures...

Status
Not open for further replies.

Programmer76

Programmer
Jul 25, 2006
35
CA
Hi,

I am new to VB.NET and am looking for a way to sort and array of structures.

Example:

I have a structure that contains first name, last name, and age. I would like to be able to sort on any of those propertise.

Any suggestions?

CES
 
One thing that I think you may want to look into is making this function to be more generic, so that it could apply to any situation.

In your code you make reference to "Age", etc. This locks down the function to just a structure that had an Age property.

I can't tell you exactly how to get there but I think that would be an improvement.
 
For sure, I agree. I really just put this together quickly to give an example for you.

CES
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top