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 theseOff the top of my head:
values, or am I missing something...
Use a copy of the variable and remove values as pulled from the variable?
-- 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
