Richard,
Great sugegstion.
This is what I have up until now. Maybe not the moste elegant way but it sort of works. I'm getting some empty elements returned that are in fact not empty lines in the file will have to look into that. This only seems to happen when the new random number and the array size are the same.
In this case the first element returned will always be the last element of the array but that is ok in this case.
I’ve been doing some test with just a 60 lines file. I’ll do some more testing when I’m back at work tomorrow and have access to the 18.490 lines file (it’s on a workstation that is turned off
).
Code:
Break on
;
$rc = SetOption ("WrapAtEOL", "on")
;
Call @SCRIPTDIR + "\RemFromArr().udf"
Call @SCRIPTDIR + "\ReadFile().udf"
;
$array = readfile("d:\test\links.txt")
$rand = Ubound($array)
$rc = SRND(0)
;
Do
?$array[$rand]
$array = Remfromarray($array, $array[$rand])
$rand = Ubound($array)
??"New array size: " $rand
Sleep 0.5
If $rand > "0"
$rand = Rnd($rand)
?"New random number: " $rand
Else
?"Array is empty."
EndIf
??
;Sleep 0.2
Until Ubound($array) = "0"
;
Sleep 3
Edited by Mart (2006-07-25 10:20 PM)
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.