Sign in to follow this  
Followers 0
igorm

Sort array multistage?

4 posts in this topic

Hi,

I'm using very good function _Array2DSortFree(), to sort my arrays. But it seems that this function does not work on every computer. It returns error that $ARRAY isn't array. But I'm sure that with my arrays is everything OK, because I use _arraydisplay to check. Anyone know what might be the problem and how can I solve it? Also, if anyone know some other function to sort array, please point me to right direction. What I need is to sort numerical and multistage. Example:

Unsorted:

Col1 Col2

a 10

b 8

c 7

d 1

e 3

Sorted:

Col1 Col2

d 1

e 3

c 7

b 8

e 10

Thanks in advance for any help.

Cheers :)

Share this post


Link to post
Share on other sites



Hi,

I'm using very good function _Array2DSortFree(), to sort my arrays. But it seems that this function does not work on every computer. It returns error that $ARRAY isn't array. But I'm sure that with my arrays is everything OK, because I use _arraydisplay to check. Anyone know what might be the problem and how can I solve it? Also, if anyone know some other function to sort array, please point me to right direction. What I need is to sort numerical and multistage. Example:

Unsorted:

Col1 Col2

a 10

b 8

c 7

d 1

e 3

Sorted:

Col1 Col2

d 1

e 3

c 7

b 8

e 10

Thanks in advance for any help.

Cheers >_<

Why not just _ArraySort()?

The _Array2DSortFree() function uses SQLite, and the topic specifically mentions interference from other SQLite operations the script might be engaged in. Where you have it failing, are you using SQLite?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Why not just _ArraySort()?

The _Array2DSortFree() function uses SQLite, and the topic specifically mentions interference from other SQLite operations the script might be engaged in. Where you have it failing, are you using SQLite?

:)

I don't use _array sort because it cant sort multistage. Also, I'm having problems even to sort numerically with it. If I have elements: 1, 2, 10, and I when I sort it with _ArraySort, I'll get 1, 10, 2. And, no I don't use anywhere SQLite. But I found what cause the problem. It is IsArray. Array2DSortFree() use it, but IsArray returns on some machines 0, and I don't know why. I used _arraydisplay just before IsArray check, and array is showed but then IsArray return 0. This is really strange. Is there any other way to check if $ARRAY is array?

Cheers >_<

EDIT: It seem that problem is not with IsArray. Something other gives 1 as return to that function.

Edited by igorm

Share this post


Link to post
Share on other sites

I found where it fails but I don't know why. It fail on _SQLite_Startup. Anyone know what could be the reason? Something in the system? Or anyone can suggest other solution. I'm really bad with sorting and I don't know how to do it myself.

Cheers :)

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