[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 RANDOM()
 Generates random numbers
------------------------------------------------------------------------------
 Syntax

     RANDOM([<lMode>]) --> nRandomWORD

 Argument

     <lMode>  Designates whether or not to return negative numbers.  The
     default creates only positive numbers.

 Returns

     RANDOM() returns a random number in the range of 0 to 65535 or when
     <lMode> is designated as .T., in the range of -32768 to +32767.

 Description

     RANDOM() produces random numbers to create a random distribution of test
     data for DEMO programs or any other application.

 Note

     .  If the <lMode> parameter is not specified, only positive
        numbers are returned.  When < lMode> is set to .T., the function
        returns the same number of positive and negative numbers.

 Examples

     .  Create a random number between 0 and 65535:

        ? RANDOM()

     .  Create a random number between 0 and 1:

        ? RANDOM()/65535

     .  Create a random whole number between 1 and 16:

        ? RANDOM()%16 +1

     .  Create a random number between -32768 and +32767:

        ? RANDOM(.T.)


See Also: RAND()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson