Altair® Monarch®

 

Function: Rand

Description

Generates a pseudo-random number in the range 0 to 32767.

Syntax

Rand()

Arguments

None.

Return value

This function returns a number in the range 0 to 32767.

Calculated field example

To generate a field filled with random numbers, use the following calculated field expression: Rand()

This application of the Rand() function has application in certain areas, such as auditing (see Filter example, below).

Filter/Find example

Certain tasks, such as auditing, require that you generate a random subset of the table database. This can be done in Monarch Classic using the Rand() function. A random group of records can be selected using the filter expression: Rand()>=300.And.Rand()<=350

You may use any numeric range in the set of numbers from 0 - 32767 to select a random group of records. You should be aware, however, that with this use of the Rand() function, the number of records returned is variable. If none of the randomly generated numbers happen to fall within the range you specify, Monarch Classic will return a blank table database.