? 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 enddoI let it run for 1/2 hour without getting "Error" printed. It is just a possibility that 1001 could be generated, but very unlikely.
? round( 999 * rand() + 1, 0 )