[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'math' (#rtl)

RandomFrom

Return a random element of an array of numbers

Declaration

Source position: line 0

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

#rtl.system.Random

  

Generate random number

RandomRange

  

Return a random number in a range

The latest version of this document can be found at lazarus-ccr.sourceforge.net.