CT_RANDOM

 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()

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.