Rnd Function

Purpose

Generates a random number between 0 (inclusive) and 1 (exclusive).

Syntax

r# = Rnd[(x)]

r! = Rnd![(x)]

r#:Double expression
r!:Single expression
x:aexp

Description

The parameter x is optional and has the effect described below. The result of Rnd is a Double. The result of Rnd! is a Single.

Rnd(0) returns tha last random number, Rnd(positive number) returns, like Rnd, a new random number. Rnd(negative number) returns always the same random number and executes Randomize negative number.

Example

Local i%

OpenW # 1

For i% = 1 To 10

Print Rnd

Next i%

Prints a random number between 0 and 1.

See Also

Random, Rand, Randomize

{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}