Error getting tags :
error 404Error getting tags :
error 404 random | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
random
Basics
Expander triangle
Type
Function
Syntax
the random of upperLimit random(upperLimit)
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns a randominteger.
Examples

random(22) -- returns a number between 1 and 22
random(item 1 of field "Numbers")
sort lines of myVar by random(the number of lines of myVar)

Additional Comments
Expander triangle

Use the random function to pick a random member of a set, or to generate a random number.

Parameters:

The upperLimit is a number.

Value:

The random function returns an integer.

Comments:

If the upperLimit is a positive integer, the random function returns an integer between 1 and the upperLimit. If the upperLimit is a number that is not an integer, the random function returns an integer between 1 and round(upperLimit).

To generate a random number between two integers, use a handler like this:

function randomInRange lowerLimit,upperLimit

return random(upperLimit - lowerLimit + 1) + lowerLimit - 1

end randomInRange

User Comments
Expander triangle