Jump to content

Sorting Array


Recommended Posts

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?

Link to comment
Share on other sites

  • Developers

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

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.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...