? INT(1000 * RAND( ) + 1)>>Instead of using 1000 in the equation above, use 999. The +1 could give you 1001, if RAND() returns 1 which it could.
>do while .T. > if ( int( 1000 * rand() + 1 ) > 1000 ) > ? "Error" > endif >enddo >>
>? round( 999 * rand() + 1, 0 ) >I have a scheduler type program that was running on multiple PC's for years under FPD 2.6a w/o any errors. After PC's were upgraded the program would generate an error from time to time on one PC only. Further investigation showed that it was a result of RAND() function returning value 1.0. The bottom line, RAND() function can return value 1.0 :)