mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2003
Posts: 114
T
Thray Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Jun 2003
Posts: 114
I made a script that required I have a list of numbers sorted.. but it needed negative AND positive numbers sorted. Unfortunately, sorttok seems to run off of absolute value so horrible things have happened.

I've tried making a bubble sort of my own, but I can't get it to work.

Don't suppose anyone would take the time to share a bubble sort script (or maybe something faster would be nice) that can do negative numbers right?


-------------
I am the self-appointed God of needlessly complex mIRCscript.
Joined: Dec 2002
Posts: 77
B
Babel fish
Offline
Babel fish
B
Joined: Dec 2002
Posts: 77
$sorttok seems to be working ok here with negative numbers...

Code:
//echo -a $sorttok(4 5 1 10 15 2 -4 -1, 32, n)


result...

-4 -1 1 2 4 5 10 15

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
From versions.txt of mIRC v6.1:
Code:
8.Fixed $sorttok() not handling negative numbers.

Did you update?

Joined: Jun 2003
Posts: 114
T
Thray Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Jun 2003
Posts: 114
I upgraded and it works EXCEPT when there is something after the negative number.

That is, I have to do this:

-216 Chaz.-215 Ranma.10 Sigma.20 Rena

And sort it in order from least to greatest.


-------------
I am the self-appointed God of needlessly complex mIRCscript.
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
You're right, this has been reported and will be fixed in the next version. At the meantime, see qwerty's post for a way around.


Link Copied to Clipboard