RandomFrom

Return a random element of an array of numbers

Declaration

Source position: math.pp line 646

  function RandomFrom(const AValues: Array of Double) : Double;  Overload;
  function RandomFrom(const AValues: Array of Integer) : Integer
                     ;  Overload;
  function RandomFrom(const AValues: Array of Int64) : Int64;  Overload;

Description

RandomFrom returns a random element from the array AValues. The return value has the same type as the type of the array elements.

See also

Name Description
RandomRange Return a random number in a range
#rtl.system.Random Generate random number