On Wed, 6 Oct 1999, Nicolas R Cueto wrote:
> Sorry to intrude with a new subject.
>
> My understanding of "any"--as in "put any line of field 1 into
> somevariable"--is that it could lead to an item being randomly selected
> (from a list) more than once. Thus, if I used "put any" to reshuffle "1 6 24
> 32 43", one possible although unwanted result might be "6 1 6 32 6".
>
> How would I script a random function so as to prevent the same item being
> picked more than once? My solutions haven't been too pretty, and so I'm
> fishing here for something more elegant.
>
> Perhaps my understanding of "any" is incorrect?
No, you can't use "any" for this. Instead, do something like this:
repeat with i = 1 to 100
put i into line i of somevar
end repeat
sort lines of somevar by random(1000)
The exact number you pass to random doesn't matter, but it should be
at least as big as your list. Then, using "repeat for each line" to
go through the contents of that variable. You can also sort and loop
over items, but not words (as your example would require).
Regards,
Scott
> Cheers,
>
> Nicolas R Cueto
>
********************************************************
Scott Raney [EMAIL PROTECTED] http://www.metacard.com
MetaCard: You know, there's an easier way to do that...