Jump to content
Sign in to follow this  

Sorting an array

Recommended Posts


Dear all,

Is there a way to perform an array sort? I want to sort it according to the Hex addresses in it...

BTW - can it be sort with the bubble sort algorithm?

Here is what I have:
















Here is what I need :P
















Share this post

Link to post
Share on other sites

#include <Array.au3>
Dim $Myarray[5][3]

$Myarray[0][0] = "Filename1.abc"
$Myarray[0][1] = "3A90"
$Myarray[0][2] = "3ABF"

$Myarray[1][0] = "Filename4.abc"
$Myarray[1][1] = "0020"
$Myarray[1][2] = "0417"

$Myarray[2][0] = "Filename3.abc"
$Myarray[2][1] = "5800"
$Myarray[2][2] = "FFFF"

$Myarray[3][0] = "Filename5.abc"
$Myarray[3][1] = "0000"
$Myarray[3][2] = "001F"

$Myarray[4][0] = "Filename2.abc"
$Myarray[4][1] = "0540"
$Myarray[4][2] = "0AFF"

_ArraySort($Myarray, 0, 0, 0, 3, 1)
For $x = 0 To 4
    $msg = ""
    For $y = 0 To 2
        $msg &= $Myarray[$x][$y] & @LF
    MsgBox(0, $x, $msg)

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.