Returns a random integer given a range of integers.

 

If just the range is passed in, the random value returned will be between 1 and the range.

 

If both the lowerValue and the optional upperValue is passed in, the random value returned will be between the lowerValue and the upperValue.

 

The maximum value that can be passed to this function is 2147483647.

 

Syntax:

value = Random( range [, or lowerValue ], [ upperValue ] )

 

Parameter:

Description:

range

A range value, or the Lower value of range.

[, or lowerValue ]

Optional:  Lower value of range.

[ upperValue ]

Optional:  Upper value of range.

 

Example:

' Returns a random number from 1 to 10
PRINT Random( 10 )
' Returns a random number from 10 to 20
PRINT Random( 10, 20 )

Returns:

A random value that is within the range values specified.

 

Links:

RandomDouble, RandomSeed

See Also:

Mathematical Functions

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 481

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software