Official Content

Returns a pseudo-random number.

Syntax

Random()

Type Returned:
Numeric

Scope

Objects: Procedure, Transaction, Web Panel, Panel, Data Provider
Generators: .NET, .NET Framework, Java, Angular, Apple, Android

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.

Samples

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.

See Also

RSeed function







Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant