IntControl (81, p1, 0, 0, 0)
Sets seed for the Random() function.
This IntControl sets the seed value used in subsequent calls to Random().
p1 - specifies a seed value.
p1 value |
Meaning |
-1 (Control Value) |
Reseed the random number generator with a WIL generated seed value. The WIL generated seed value has various time based components and will change many times in one second.
|
1 (Control Value) |
Allow the run time library to select a seed. This may allow a predictable pattern to the generated numbers
|
Other positive numbers (Seed Value) |
Use provided value for the seed. This will allow a predictable pattern to the generated numbers
|
Other negative numbers - Undefined results. |
Undefined results. |
Note: Providing a fixed seed value in a program will result in a predictable pattern to the generated numbers. This is often used for program debugging.
For normal programs, it is recommended that either the default WIL-generated seed value be used or that a provided seed value have a truly random or time-based component so that the pseudo-random numbers generated are more difficult to predict.
Returns 1.