Skip to main content

random

random: integer

ParameterTypeDescription
Resultinteger<-Random number

Description

random returns a random integer value between 0 and 32,767 (inclusive).

To define a range of integers from which the random value will be chosen, use this formula:

 (random%(vEnd-vStart+1))+vStart

The value vStart is the first number in the range, and the value vEnd is the last.

Example

The following example assigns a random integer between 10 and 30 to the vlResult variable:

 var vlResult : integer
vlResult = (random%21)+10