Random function

Official Content
This documentation is valid for:

To return pseudo-random numbers.

Syntax

Random()

Type Returned:
Numeric

Description

It returns a value of the numeric type with decimals N(11.9) in the range 0 to 1. The seed can be indicated through the RSeed function. If it is not explicitly initialized before calling the Random function, then it will be automatically initialized with a different value every time the application is run.

Example

Do While <Condition>
   ...
   &SesNro = Random() // Example: 0.11, 0.98, 0.54, etc.
   ...
EndDo

It generates N pseudo-random numbers. Every time the application is run, it generates a different sequence of numbers because the seed will always change.

Scope

Objects Procedure object, Transaction object, Web Panel object
Languages .NET, Java, Ruby, Visual FoxPro
   

See also

RSeed function