### Rnd

Basic and Crystal syntax.

##### Overloads

- Rnd ()
- Rnd (seed)

##### Argument

seed is an optional Number value argument.

##### Returns

A Number value.

##### Action

Rnd returns a random number greater than or equal to 0 and less than 1. If seed is equal to 0, Rnd returns the random number that was returned from the previous call to Rnd. If seed is not supplied or is greater than 0, then Rnd returns the next random number in the internally generated sequence of random numbers. If seed is less than 0, then Rnd uses this value of seed to start a new random number sequence and returns the first value in this sequence.

##### Typical uses

Used when your formula requires a randomly generated number such as for statistical calculations or for selecting records at random to limit the data in a report.

##### Comments

- This function is similar to the Visual Basic function of the same name.
- You can call Rnd without ever starting a new random number sequence by specifying a negative seed argument. If you do so, an internal seed will be generated using the system clock.
- The reason to start a new random number sequence by calling Rnd with a negative seed argument, and then making subsequent calls to Rnd without an argument (or with a positive argument) is so that the report will look exactly the same every time it is previewed. In other words, it allows you to make use of random numbers, but get a reproducible result.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com