Hi Ole,
The problem is in your sort-func all the return values are true. I think
this'll give better results:
sort-func: func [n1 n2] [
loop input-length [
n1: n1 + 1
n2: n2 + 1
if n1 > input-length [n1: 1]
if n2 > input-length [n2: 1]
c1: pick input n1
c2: pick input n2
if c1 > c2 [return false]
if c2 > c1 [return true]
]
return true
]
It seems a little odd, though, that there's no way for the comparison
function to say that the two values were equal.
By the way, your script redefines 'input, which might not be a good idea.
Eric