Random.InRange

From Xojo Documentation

Method

Random.InRange(minR As Integer, maxR As Integer) As Integer

Supported for all project types and targets.

Returns a random number as an Integer in the range from minR to maxR, inclusive.

Sample Code

The following example generates a random integer in the range from 0 to 1,000.

Label1.Text = Str(System.Random.InRange(0, 1000))