Hi Henrik,

> Imagine having thousands of articles in a database, AFAIK using
> collect to get them all and then getting a random subsection would not
> be the best solution as the process would eat up a lot of memory.

You could use 'maxKey' to get the highest key in the database, and then
use 'rand' repeatedly to find objects with 'db':

   (let Max (maxKey (tree 'aid '+Article))
      (do 100
         (until (db 'aid '+Article (rand 1 Max)))
         (printsp @) ) )

- Alex
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to