Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>random()</b> http://www.X-Hacker.org [<<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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson