BigDaddyO Posted October 24, 2007 Posted October 24, 2007 (edited) I am trying to sort a Multi Dimension array using the _ArraySort() and I can't seem to figure it out. Also, there is no example in the help file for using Multiple Dimension Arrays. Here is what I have been playing with. I want to be able to sort using the Second dimension. #include <Array.au3> Dim $aAppInstall[2][5] = [["Third", "Second", "Fourth", "First", "Fifth"], [3,2,4,1,5]] _ArrayDisplay($aAppInstall, "UnSorted") _ArraySort($aAppInstall, 1, 1, 2, 5, 1);<- What's Wrong? _ArrayDisplay($aAppInstall, "Sorted") Thanks, Mike Edited October 24, 2007 by MikeOsdx
Developers Jos Posted October 24, 2007 Developers Posted October 24, 2007 try this: #Tidy_Parameters=/rel 1 #include <Array.au3> Dim $aAppInstall[5][2] = [[ "First", 1],["Third", 3],["Second", 2],["Fourth",4],["Fifth",5 ]] _ArrayDisplay($aAppInstall, "UnSorted") _ArraySort($aAppInstall, 1, 0, 0, 2, 0) _ArrayDisplay($aAppInstall, "Sorted by name column 1 descending..") _ArraySort($aAppInstall, 1, 0, 0, 2, 1) _ArrayDisplay($aAppInstall, "Sorted number column 2 descending..") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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