Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>random()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
RANDOM()

Syntax:     RANDOM(<expL>)

Arguments:  <expL> denotes whether negative numbers are to be allowed.

Returns:    A numeric value.
            A random number in the range of 0 to 65535 or, if <expL>
            is(.T.), in the range from -32768 to +32767.

Usage:      This function can be used to produce random numbers, for
            example, to compile randomly distributed test data for demo
            programs, or for many other applications, such as statistical
            programs.

Notes:      Exclusively positive numbers will be produced, if the
            argument <expL> is not indicated.  With <expL>=(.T.) the
            function will most likely return as many positive as negative
            numbers.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * Producing a random number between 0 and 65535
            ? RANDOM()

            * Producing a random number between 0 and 1
            ? RANDOM()/65535

            * Producing a whole number between 1
            * and 16
            ? RANDOM()%16+1

            * Producing a random number between -32768 and
            * +32767
            ? RANDOM(.T.)





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