Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
FUNCTION RND_POS(N)
STATIC XRNDSEED := .123456789
IF XRNDSEED = .123456789
XRNDSEED += VAL(SUBSTR(TIME(), 7, 2)) / 100
ENDIF
XRNDSEED := (XRNDSEED * 31415821 + 1) / 1000000
RETURN INT( (XRNDSEED -= INT(XRNDSEED)) * N)
* Function...RAND() function
* Syntax.....RAND(expN)
* Parameters.A numeric expression that evaluates to an integer.
* Returns....An integer in the range of 0 to n-1.
* Notes......Requires that a memory variable called "seed" be
* initialized to a value between 0 and 1 before calling
* For example:
* seed = VAL(SUBSTR(TIME(),8,1)) * .1
FUNCTION RAND
PARAM n
seed = 997 * seed
seed = seed - INT(seed)
RETURN (INT(n * seed))