sortKey
Posted: Thu Sep 27, 2012 10:13 am
Hi fellow LiveCoders,
i have got a question regarding the sort function in LiveCode 5.5.1 running on MacOS 10.8.2.I need to generate a random order of lines in a variable. I usually use the following code:
(A)
Now i wonder what happens exactly when I run this line. Is is so that the output of the random(1000000) function is a number between 1 and 1000000. So, the code might for example look like this:
(B) ? Or is that my first misunderstanding? Running the code (B) in the message box does return "true" but does not change the order of the items in the variable, but code (A) does...What does the sortKey element of the sort function mean? I am a bit puzzled. The dictionary was no help either...
Hope you can help me
Cheers,
Malte
i have got a question regarding the sort function in LiveCode 5.5.1 running on MacOS 10.8.2.I need to generate a random order of lines in a variable. I usually use the following code:
(A)
Code: Select all
sort lines of cSet1 by random(1000000)
Now i wonder what happens exactly when I run this line. Is is so that the output of the random(1000000) function is a number between 1 and 1000000. So, the code might for example look like this:
(B)
Code: Select all
sort lines of cSet1 by 594834
Hope you can help me

Cheers,
Malte