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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting array on two fields

Status
Not open for further replies.

Rajkumar1978

Programmer
Mar 21, 2003
2
IN
Hi programmers,
I want to sort an three dimensional array based on two columns.

For ex. The output should be:
1 0 0
1 0 1
1 0 2
2 0 1
2 0 3
3 0 0
4 0 0
5 0 1
etc..
The above ex. is sorted on first and third column.

Regards
Rajkumar
 
well you could do it in a sort of trick way

example 10(removing the second column in ur array) is lesser than 11,cant you sort it like that?

example

1 0 0
1 0 1
1 0 2
2 0 1
2 0 3
3 0 0
4 0 0
5 0 1


becomes
1 0
1 1
1 2
2 1
2 3
3 0
4 0
5 1


now you can sort this easily using a hidden variable and setting it into an array and then retrive it later

u can also check out this site

 
See faq329-3362 on sorting via ADO disconnected Recordsets. I just updated it to reflect your situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top