repeat with i=

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Thu Jul 14 03:05:33 EDT 2011


...so for a random selection, enforcing the use of all 6 items, would this work?

put "1,2,3,4,5,6" into x
repeat until x is empty
	put any item of x into y
	do something
	delete item y from x
end repeat

Best,
Keith..


On 14 Jul 2011, at 05:58, J. Landman Gay wrote:

> On 7/13/11 11:33 PM, Pete wrote:
>> You're right, should probably be something like "replace y&  comma with
>> empty in x".
> 
> Plain old "delete" does it.
> 
> Also, not everyone knows about the "any" keyword but it's really handy for lines like this:
> 
>  put item random(the number of items in x) of x into y
> 
> Which is more readable as:
> 
>  put any item of x into y
> 
> I'm very fond of "any".
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> 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