janschenkel at yahoo.com
Wed Nov 12 15:21:45 CST 2008
--- Richard Gaskin <ambassador at fourthworld.com> wrote:
> Mark Brownell wrote:
> > I'm surprised that the random seed was not
> Me too. Wouldn't it suffice to do this before each
> set the randomSeed to random(4570422)
> Richard Gaskin
In theory, that could result in the same series of
random numbers multiple times, as the first random may
start with the same randomseed as another, thus
resulting in the same random first number, and thus
the same second number and so forth.
If memory serves me well (and I admit mine is
comparable to that of a goldfish) then the engine
initializes the randomseed to the value of the
milliseconds at startup. Which means that unless
you're a really-really-fast doubleclicker, two
separate Rev instances will give you different random
numbers out of the box.
The ability to set the randomSeed is great, but it's
even better that it starts off random, unlike .NET
where you actually have to kick off the randomseed
with something before you use the randomizer,
otherwise you end up with the same series of 'random'
numbers every time you run the same application.
Quartam Reports & PDF Library for Revolution
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
More information about the use-livecode