Yes, I would like a DIFFERENT 100 every time, otherwise the FIRST would have
worked. The first thing I thought of was your basic routine, but I just
wondered if I'd overlooked a SELECT option that I wasn't familiar with.

I'm wondering which would be more efficient; the basic subroutine or
Christophe's suggestion of an I descriptor?

Thanks,
--
Dave Walker
                8..7 4(())  -:&:-
  -:&:-    8.74 .74(())
                 ((88.74  ..74  -:&:-
                        ((88.74   * Peace

 

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of 
> Martin Phillips
> Sent: Tuesday, August 09, 2005 10:46 AM
> To: [email protected]
> Subject: Re: [U2] True random select lists?
> 
> 
> Hi Dave,
> 
> > I've built a database of all my mp3s. Now I want to 
> generate a random list
> > of 100 songs. s there a way to do that with a SELECT 
> statement, or must I
> > muck around in basic to do so.
> 
> This depends what you mean by "random". If you are happy to 
> agree that the
> hashing process is effectively random from an external point 
> of view, simply
> use
>    SELECT filename FIRST 100
> 
> However, you seem to want a different 100 records each time. 
> I cannot see
> any way to do this aside from using a Basic program. Even 
> then, you will
> have to start with a list of all the records and then extract 
> 100 items
> randomly...
> 
> OPEN 'filename' TO FVAR ELSE STOP
> SELECT FVAR
> READLIST LIST THEN
>    N = DCOUNT(LIST, @FM)
>    FOR I = 1 TO 100
>       X = RND(N) + 1
>       ID = LIST<X>
>       DEL LIST<X>
>       N -= 1
>    NEXT I
> END
> 
> The above idea assumes that the list has over 100 items in it
> 
> The basic problem here is that computers are supposed to be 
> repeatable. What
> you want is random behaviour so you are unlikely to find it 
> in the standard
> toolset.
> 
> 
> Martin Phillips
> Ladybridge Systems
> 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB
> +44-(0)1604-709200
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to