Jump to content

_ArraySort, only 1st digit sorted

Recommended Posts

Hi Guys

This isn't stopping me from accomplishing what I wanted BUT its annoying me a little, I am building 1 array out of 6 arrays using _ArrayConcatenate() builds fine, but after that I want to sort it it is sorting but not fully


is becoming


I would prefer

3,11,13 etc

Why is it doing the above, like treating each digit individually

Link to post
Share on other sites

I know exactly what is wrong. I dont know how to fix it properly, but it is sorting it in numerical order like so.

Look at the first character in all of the values and sort accordingly.

Look at second character and sort accordingly.

So it gets something like 11,1,2,12

and turns it into 1,11,12,2 when it should be 1,2,11,12

The only way I see this being fixed would be like so;


Or something like that, as I dont personally know any other way to do it.

Link to post
Share on other sites

It's because _ArraySort is a "String" sort so that is the correct order but what you want is a "numeric" sort. Try _ArraySortNum() by SmOke_N



Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver: - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...