>>I believe in simple things... :)
>>
>>n=reccount()
>>=rand(-1)
>>x=rand()
>>nextnumber = int(n*x)
>>
>>then save the number into array[10]
>>get nextnumber, check if it is already in array, if not save it there... 10 times in a row (or more :)
>
>Here's a similar version of what I finally did. I random the first and take 10 records from that position. You'll see that I applied a small verification to make sure we scroll from the first record if we are at the EOF() if we still haven't found 10 records. In this case, NUMERO is the unique key.
>
>SELECT NUMERO,.T. FROM QUESTION WHERE ... INTO CURSOR TEMP
>LOCAL lcInlist
>lcInlist=''
>GO BOTTOM
>GO INT(RAND(-1)*RECNO())+1
>FOR lnCompteur=1 TO 10
> lcInlist=lcInlist+ALLTRIM(STR(NUMERO))+','
> SKIP
> IF EOF()
> GO TOP
> ENDIF
>NEXT
>lcInlist=SUBSTR(lcInlist,1,LEN(lcInlist)-1)
>SELECT NUMERO,TITLE,CREATION,NOTES FROM QUESTION;
> WHERE INLIST(NUMERO,&lcInlist) INTO CURSOR TEMP
>
What's the use of the GO BOTTOM?
Vlad