I'm by no means the authority on random numbers, but the seed shouldn't
change as you generate numbers. It is the number that initializes the
sequence. If you want to restart the sequence, just re-set the seed:

dim r as new Random
dim s as string

r.Seed = 123456789

s = format( r.LessThan( 1000000 ), "#" ) + EndOfLine _
  + format( r.LessThan( 1000000 ), "#" ) + EndOfLine _
  + format( r.LessThan( 1000000 ), "#" ) + EndOfLine _
  + "Seed: " + format( r.Seed, "#" ) + EndOfLine + EndOfLine
r.Seed = 123456789
s = s + format( r.LessThan( 1000000 ), "#" ) + EndOfLine _
  + format( r.LessThan( 1000000 ), "#" ) + EndOfLine _
  + format( r.LessThan( 1000000 ), "#" ) + EndOfLine _
  + "Seed: " + format( r.Seed, "#" )

MsgBox s

Output:
212746
817269
573867
Seed: 123456789

212746
817269
573867
Seed: 123456789

While the seed doesn't change when using a Random, re-assigning it does
restart the sequence.



-Adam
dingostick.com


On 3/3/07, Robert Woodhead <[EMAIL PROTECTED]> wrote:
>
> Random.Seed is a double, not an integer as the documentation would
> have you believe:
>
>
> http://www.realsoftware.com/feedback/viewreport.php?reportid=sjguzxud
>
> Once set, Random.Seed never changes, even as you generate random
> numbers.  So you can't easily restart a random number sequence in the
> middle of a set of calls.  This is contrary to every other
> implementation of random number generation I've seen in the last,
> oh, 30 years.
>
>
> http://www.realsoftware.com/feedback/viewreport.php?reportid=kspotawy
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>



-- 
-Adam
dingostick.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to