Field-Map Scripting

4.1.3.1.20 RandomRange

RandomRange function


Prototype:

function RandomRange(const AFrom, ATo: integer): integer;

Description:

The RandomRange function returns a random number within the range AFrom <= X < ATo.

Syntax:

RandomRange(From,To);


Part

Description


From

An integer parameter defining the lower end of the desired interval


To

An integer parameter defining the upper end of the desired interval

Return value:

An integer random number from within the defined range



Example:


var

 from, to1, x : integer;


begin

 from:= 1;

 to1:= 10;

 x:= RandomRange(from, to1);

 ShowMessage(IntToStr(x));

end.

// Note: you cant use name variable "to" because this word is keyword of programming language


Output in Field-Map Data Collector:


See also:

Power; Round; RoundTo, RoundVariant; Round2int, Cos; ArcCos; ArcCosH; Sin; ArcSin; ArcSinH; ArcTan; ArcTan2; ArcTanH; CosH; SinH; Tan; TanH; Random; RandomRange; Randomize; Floor; Ceil; Int; Frac; Log10; Ln; Exp; Abs; Min; Max; Odd; SecondsBetween;CompareValue; SameValue; Trunc


Example