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


Syntax:        L_RAND(<expN>)


Purpose:       Generate a pseudo-random number.


Arguments:     <expN1> is the minimum value the function should return.
               <expN2> is the maximum value the function should return.
               <expN3> is the starting value (seed) from which the
               pseudo-random number will be generated.

               If <expN1> is 0 the seed becomes the number generated
               the last time the function was called.

               If <expN2> is positive, it resets the starting value
               to seed.

               If <expN3> is negative, it resets the starting value
               to default seed.


Returns:       A number between <expN1> and <expN2>.
               An error if <expN3>, seed, is greater than 25000.


Usage:         Called repeatedly to give a serias of pseudo-random
               numbers.


Examples:      * Generate random numbers
              ? L_RAND(1,10,12345)             && Result: 4.82
              ? L_RAND(1,10,0)                 && Result: 5.38
              ? L_RAND(1,10,0)                 && Result: 8.03
              ? L_RAND(1,10,0)                 && Result: 2.83
              ? L_RAND(1,10,-1)                && Result: 5.23


Language:      C

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