Random

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


Random Number

ParameterTypeDescription
This command does not require any parameters
Function resultNumberRandom number

Description

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

To define a range of integers, use this formula:

   (Random%(End–Start+1))+Start

The value start is the first number in the range, and the value end is the last.

Example

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

   vlResult:=(Random%21)+10

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next