Random but unique

mark mitchell cowhead at mac.com
Sat Jan 18 17:12:01 EST 2003


On Sunday, January 12, 2003, at 06:31 AM, use-revolution-
request at lists.runrev.com wrote:

> How do I pick randomly five lines out of vChooseFrom, putting them into
> vSelected:
>

This is an old message (I was away).  Did this ever get answered to your 
satisfaction?  I do this sort of thing all the time and the easiest way 
for me is to just sort the list by random, then take the top 5.

sort lines of vChooseFrom by random(1000)
put lines 1 to 5 of vChooseFrom into vSelected

That way, you know you do not have repeats (so long as the original 
list, vChooseFrom, does not have repeats).

mark mitchell
Japan




More information about the use-livecode mailing list