BW> Well, test it yourself. I did and found a very good
BW> distribution. You have to learn to trust your tools,
BW> Kurt.
For some reason, I thought you were reading each line
and either accepting or rejecting based on a 1:0 choice,
and then ending or testing the next accordingly.
I must be spoiling for an argument, probably because I
haven't been refrigerated soon enough after being
prepared. I should take a chill pill... ;)
If you are going to read through the whole file, though,
you might as well save an index to each line and just
load the index and choose one at random. Then you only
need to load the whole thing one time, thereafter loading
only the index. Processing the file to make the lines into
fixed length records would make it even faster, since you
could get the file size and divide by the size of the
record to get the number of lines and then grab one.
The records could be padded with spaces and terminated with
the CR/LF to provide text compatibility if required, or
NUL terminated if the file is to be used only within the
given routine, or with similar constructs, and not as an
ordinary text file.
> ] A one-eyed man among the blind is a dangerous heretic.......
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|