Hi Carver. Thanks but I think I'll stick with this one. But instead of adding the condition to the Until section I just changed the randomization. It is now random(filesize(f)-1)+1 (This makes sure that the random number is not bigger than the filesize and is not zero) Yes it takes more time but the difference can be defined in miliseconds. I'm finished with it. It works fine. There is just a minor error left to fix. If I run the program for the first time, I add some words to the database but I need to exit the program before it can do something with it because something creates a disk read error if I call the question or correct procedures. (Interesting that it only occurs for the first run... But I checked it and each time the file was reset or rewritten it was also closed, so that's not the problem currently I have no idea but I will look at it more deeply with some breakpoints and watches tonight)