Sign in to follow this  
Followers 0
spyrorocks

Sorting Array

4 posts in this topic

Hello.

I need some help sorting an array. I have tryed _arraysort() but it dident work

i have a ini file that looks like this:

[hello]

2=fsddfsd

4=dvvdsv

1=dvsvdvsdv

9=ccdvvsd

what i need to do is use IniReadSection () to read the ini sections then i need to somehow sort the array so that the highest key value is at the beginning and the lowest is at the end.

How would i do that?

Share this post


Link to post
Share on other sites



Thats odd. ive never used _arraysort but from the documentation i dont see why it wouldnt work what parameters did you use.

Share this post


Link to post
Share on other sites

This should get you started:

#include<array.au3>
$array=IniReadSection("test.ini","hello")
_ArraySort($array,1,1,0,2,0)
For $x = 1 to $array[0][0]
    MsgBox(0,"record:"& $x,"field 1:" & $array[$x][0] & "  field 1:" & $array[$x][1])
Next

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0