[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
RANDOM Return a Random Number pp 143
Syntax: Random <IntVar> ;
Type: Integer or Real
Form: Function
Purpose: Return a random number of type Real or type Integer.
Notes: Random used without the optional IntVar returns a Real number
that is greater than or equal to 0 and less than 1.
When called with the optional IntVar, an integer number greater
than or equal to zero and less than IntVar is returned.
----------------------------------------------------------------------------
Usage:
VAR
IntVar : Integer ; { Integer variable }
RealVar : Real ; { Real variable }
BEGIN
RealVar := Random ; { 1 > RealVar >= 0 }
IntVar := Random (4) ; { 4 > IntVar >= 0 }
END.
See Also:
Randomize
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson