CosmosTunes Posted October 24, 2008 Posted October 24, 2008 (edited) Hello, I have a problem with the sort of an array. It has 2 dimensions like: $test[0][0] = 1111 $test[0][1] = "This is a entry" $test[0][2] = 10 $test[1][0] = 11125 $test[1][1] = "This is a entry2" $test[1][2] = 15 ... Now i want to sort the first column of the second dimension: _ArraySort($array, 0, 1, 0, 0) But I dont get what i want. I get this: 10 103 1006 20 2003 .... but i want a number order like this: 10 20 103 1006 2003 .... What should i set up or is it not possible? Any help would be appreciated. Thanks, CosmosTunes Edited October 24, 2008 by CosmosTunes
jvanegmond Posted October 24, 2008 Posted October 24, 2008 #include <Array.au3> Dim $aInput[5] = ["10","103","1006","20","2003"] ;; THIS CODE CONVERTS THE STRINGS INTO NUMBERS, SO THEY CAN BE SORTED For $i = 0 to UBound($aInput)-1 $aInput[$i] = Number($aInput[$i]) Next ;;THIS CODE _ArraySort($aInput) _ArrayDisplay($aInput) github.com/jvanegmond
CosmosTunes Posted October 24, 2008 Author Posted October 24, 2008 (edited) nice thanks i will try later Edit: worked 100% thanks again Edited October 24, 2008 by CosmosTunes
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