:-)) Thanks, this got me thinking and solved the problem... Didn't think of removing the found line of my first var.
So simple, so easy... Thanks! Ton > From: Dar Scott <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Sat, 11 Jan 2003 13:21:27 -0700 > To: [EMAIL PROTECTED] > Subject: Re: Random but unique > > > On Saturday, January 11, 2003, at 12:52 PM, [EMAIL PROTECTED] wrote: > >> Could you explain this? Removing values is not what I need, I need >> these >> values, or am I missing something... >>> >>> Use a copy of the variable and remove values as pulled from the >>> variable? > > Off the top of my head: > > -- function to return n random lines from a list > -- with no line selected more than once > function getUniqueRandomLines theList n > local theLines, pick > put empty into theLines > if n > the number of lines in theList then throw "Can't get random > lines" > repeat for n times > put random( the number of lines in theList) into pick > put line pick & lineFeed after theLines > delete line pick of theList > end repeat > return theLines > end if > > This may not fit your exact needs, but perhaps it might inspire > something that will. This may have a speed problem with long lists, so > I'm not completely happy with this. > > Or did I miss something about this? > > (I don't think "any" will work for the above method, unless some other > method is used to remove the line.) > > Dar Scott > > > _______________________________________________ > use-revolution mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/use-revolution > _______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
