repeat with i=

Roger Eller roger.e.eller at sealedair.com
Wed Jul 13 21:12:08 EDT 2011


On Wed, Jul 13, 2011 at 9: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.
>
> Tim
>

This won't guarantee that all 6 numbers will get used (because it is
random), but it will loop 6 times.

  repeat with i = 1 to 6
     put random(6) into x
     answer "whatever" && x
  end repeat

˜Roger



More information about the use-livecode mailing list