BigGrayBeast Posted June 25, 2007 Posted June 25, 2007 If I had this array and first names, last names, and wives names: a[1][1] = "John" a[1][2] = "Doe" a[1][3] = "Ann" a[2][1] = "Bill" a[2][2] = "Adams" a[2][3] = "Joanne" How would I sort by Last name? Thanks
randallc Posted June 25, 2007 Posted June 25, 2007 (edited) Hi, Hard to know which are your lastnames! Try; ;array2dsortex.au3 #include <Array.au3> local $arGrid[3][2] =[["Bill", "Clinton"],["John", "Huskins"], ["George", "Bush"]] _ArrayDisplay($arGrid, "Before Sort");, 1, 1); [2D, transposed] ;_ArraySort ( ByRef $a_Array [, $i_Descending [, $i_Base=0 [, $i_Ubound=0 [, $i_Dim=1 [, $i_SortIndex=0 ]]]]] ) _ArraySort($arGrid,0,0,UBound($arGrid,1)-1,UBound($arGrid,2),UBound($arGrid,2)-1) _ArrayDisplay($arGrid, "After Sort on ASC surnames;_ArraySort($arGrid,0,0,UBound($arGrid,1)-1,UBound($arGrid,2),UBound($arGrid,2)-1)");, 1, 1); [2D, transposed] _ArraySort($arGrid,1,0,UBound($arGrid,1)-1,UBound($arGrid,2),UBound($arGrid,2)-1) _ArrayDisplay($arGrid, "After Sort on DESC surnames;_ArraySort($arGrid,1,0,UBound($arGrid,1)-1,UBound($arGrid,2),UBound($arGrid,2)-1)");, 1, 1); [2D, transposed]Best, Randall Edited June 25, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now