Purpose
Returns a random number. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Rnd( list_type )
list_type selects the kind of random number list.
Return Value
A number of type float between 0 and 1 (exclusive).
Description
The Rnd() function returns a random floating-point number, greater than zero and less than one.
The conventional use is of the form Rnd(1), in which the function returns a random number. The sequence of random numbers is always the same unless you insert a Randomize statement in the program. Any positive list_type parameter value produces this type of result.
A less common use is the form Rnd(0), which returns the previous random number generated by the Rnd() function. This functionality is provided primarily for debugging purposes.
A very uncommon use is a call with a negative list_type value, such as Rnd(-1). For a given negative value, the Rnd() function always returns the same number, regardless of whether you have issued a Randomize statement. This functionality is provided primarily for debugging purposes.