There can be a number of reasons you will want your mobile app to generate random numbers. You might create a slot or another gambling app or simply want enemy robots in a game to come from random vectors. Regardless of your need, LiveCode makes it easy to generate random numbers.
In this recipe, you will create a user interface that allows the user to enter upper and lower limits and then generate a random number within those limits.
Open LiveCode and create a new main stack.
Drag a new label field to the card and set the following properties:
Name:
fld_Lower
foregroundColor: Yellow
Width:
158
Height:
32
Location:
87
,64
Font: Courier
Text size: 18
Text style: Bold
Align text center
Contents:
Set Lower Limit:
Drag a second label field to the card and set the following properties:
Name:
fld_Upper
foregroundColor: Yellow
Width:
158
Height:
32
Location:
259
,64
Font: Courier
Text size: 18
Text style: Bold
Align text center
Contents:
Set Upper Limit:
Drag...