Math.Random

Top  Previous  Next

 

Syntax

function Math.Random(Range: integer): variant

 

Alternative Names

ibec_Random

 

Description

Generates a random number.

 

The Return Value is a random integer number between 0 (including) and the given Range (excluding), if Range is zero, the result is a floating point number within the range 0 (including) and 1 (excluding).

 

See Also

Math.RandomRange

 

Example

execute UDSBlock returns (value_out varchar(100))

as

begin

  i = 0;

  while (i < 10) do

  begin

    value_out = Math.Random(i); /* returns a floating point value on first call, i being 0 */

    suspend;

    i = i + 1;

  end;

end