Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Monad Research
Message
From
19/01/2009 13:34:40
 
 
To
19/01/2009 13:28:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01375100
Message ID:
01375166
Views:
18
>>Unless you seed the rand() function by using a negative number, like rand(-1), you will ALWAYS get the same series of values.
>
>
>If I do:
>
>
>?rand(1)
>?rand()
>?rand()
>?rand()
>
>
>I will always get the same values.
>
>But when I do:
>
>
>?rand(0)
>?rand()
>?rand()
>?rand()
>
>
>I always get different values.
>
>So what's the difference between rand(-1) and rand(0)?

If you reboot your computer, you will get the same values, AFAIK. Anyway, help suggests to use a negative value.
Previous
Reply
Map
View

Click here to load this message in the networking platform