From Xojo Documentation


Random.LessThan(Range As Integer) As Integer

Supported for all project types and targets.

Returns a random number as an Integer in the range greater than or equal to 0 and less than Range (value >= 0 And value < Range).

Sample Code

This example generates a random integer from 0 to 99:

Label1.Text = Str(System.Random.LessThan(100))