repeat with i=

Jerry J jhj at jhj.com
Wed Jul 13 21:37:51 EDT 2011


On Jul 13, 2011, at 6:01 PM, Timothy Miller wrote:

> Hi,
> 
> Let's say that I want to do something like
> 
> repeat with i = 1 to 6
> do "whatever" & i
> end repeat
> 
> Except, I want 1 to 6 to be in random sequence
> 
> I could think of a few kludgy ways to do this.
> 
> Is there a standard approach? A simple approach?
> 
> Thanks in advance.

on mouseUp
   local theNums
   put "1,2,3,4,5,6" into theNums
   sort  items of theNums numeric by random(1000000)
   repeat for each item I in theNums
      --do "whatever" & I      
   end repeat
   put theNums
end mouseUp





More information about the use-livecode mailing list