Quote:
Quote:
I need to make a script to sort up to 2500 items that are each up to 4 characters apiece

Not sure in what "form" you want your output data (besides sorted)... You could sort with hash tables and the problem of "set line too long", size hash tables are practically unlimited in number of entries...
Code:
alias hashtest {
  hsetup
  hashout
}
alias hsetup {
  var %n 1
  while (%n <= 2500) {
    hadd -mb hSort %n $+($rand(A,Z), $rand(A,Z), $rand(A,Z), $rand(A,Z))
    inc %n
  }
}
alias hashout {
  var %n 1
  while (%n <= 2500) {
    echo -s $hget(hSort, %n)
    inc %n
  }
}
Thanks for the reply. Yes but this script would simply return every item in the db and in correct order since the item numbers were done consecutively. In my script each item was added consecutively and is storing data. when i do a $hfind().data on my hash table the values it returns arent sorted in any way because apparently hash tables dont sort. If my script matches more than around 250 items i cant string them along like item1;item2;item3 and pass them to $sorttok because the line is too long.