Random sort demonstration

Dar Scott dsc at swcp.com
Thu May 23 13:59:55 EDT 2013


Yikes!  I was thinking the default was automatic and not text.  Good idea!

Now, I wonder if it makes a difference in the final probabilities.  Maybe performance is influenced.  


On May 23, 2013, at 10:37 AM, Robert Brenstein wrote:

> On 23.05.2013 at 9:51 Uhr -0500 Geoff Canyon apparently wrote:
>> To Dar's point, here the stable sort means that you should never use this
>> to get a random sort:
>> 
>> sort lines of someContainer by random(the number of lines of someContainer)
>> 
>> You are almost guaranteed to get less than random results. Instead always
>> use something like
>> 
>> sort lines of someContainer by random(999999999)
>> 
>> gc
> 
> I wonder why nobody suggests adding "numeric" parameter to random sorts like above. After all, the sort column is a number but without that parameter is sorted as ascii text not numeric value.
> 
> Robert
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list