**Random()**

**Syntax**

Result =Random(Maximum [, Minimum])

Returns a random number from zero to the given maximum value (both values included).

**Parameters**

MaximumThe maximum value. This value needs to be positive (zero included) and may not exceed the maximum positive integer value. Minimum (optional)The minimum value. It may not exceed the maximum value. If specified, the random number will be from the minimum value to the maximum value (both values included). This value needs to be positive (zero included) and may not exceed the maximum positive integer value.

**Return value**

Returns a value from zero to the maximum value (both values included), unless a minimum value is specified.

**Remarks**

Additionally RandomSeed() may be used to change the random number seed. RandomData() can be used to fill a memory buffer with random data. RandomizeArray() or RandomizeList() can be used, to randomize the elements of an array or a list.

Note:This command uses a pseudorandom number generator which is very fast and produces randomly looking output but it is not strong enough for cryptographic purposes. The slower CryptRandom() command can be used if more secure random number generation is required.

**Example**

RepeatDice = Random(6, 1) ; get a value between 1 and 6, including 1 and 6 Choice = MessageRequester("Roll the dice", "You got a " + Dice + ", roll again?", #PB_MessageRequester_YesNo)UntilChoice = #PB_MessageRequester_No

**See Also**

RandomSeed(), RandomData(), CryptRandom(), RandomizeArray(), RandomizeList()

**Supported OS **

All