Advertisement

06.04.2007 at 05:58AM PDT, ID: 22610837
[x]
Attachment Details

What's the best way to sort a multi-dimensional array of strings (VBA/VB6)

Asked by PatternNut in Visual Basic Programming

Hi Experts,

I'm working in VBA/VB6 and need to sort a two-dimensional array, for instance

array(1,0) = "Fred"
array(1,1) = "13"
array(2,0) = "Jamie"
array(2,1) = "Friday"
array(3,0) = "Andrew"
array(3,1) = "Date"

I want to sort the array using the zeroth index (ie the names), so that the sort would return an array:

array(1,0) = "Andrew"
array(1,1) = "Date"
array(2,0) = "Fred"
array(2,1) = "13"
array(3,0) = "Jamie"
array(3,1) = "Friday"

I've used quicksort for my single dimensional arrays, but my understanding is that I can't do that on this.  Any advice would be much appreciated.

Cheers,

PatternNutStart Free Trial
 
Loading Advertisement...
 
[+][-]06.04.2007 at 06:39AM PDT, ID: 19208377

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Sign Up Now!
Solution Provided By: Dhaest
Participating Experts: 1
Solution Grade: B
 
 
[+][-]06.10.2007 at 04:29PM PDT, ID: 19254972

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32