@PhilOfPerth I have tested the method above and have to say I have been converted.
1. you don't have to do anything to Collins.txt but you could add an extra line first, no big deal if you don't. So no 2 RA files needed nor do you have to keep at least one RA file open while the program is running, not the greatest to have a file open when you quit though unlikely to do any damage. The entire file is loaded into a very long string and done in one giant gulp! You now have the contents accessible by RAM not file access, much faster.
2. Just look how it finds a word, it uses INSTR() ONCE because we enclose the word with a chr$(10) at front and a Chr$(9) on end to guarantee the words we find are the first on any line of Collins.txt file.
It does use INSTR() again just to find the end of that particlar line. So there is no playing of the guessing game that we do with an RA file. It's pretty cool efficiency wise.
1. you don't have to do anything to Collins.txt but you could add an extra line first, no big deal if you don't. So no 2 RA files needed nor do you have to keep at least one RA file open while the program is running, not the greatest to have a file open when you quit though unlikely to do any damage. The entire file is loaded into a very long string and done in one giant gulp! You now have the contents accessible by RAM not file access, much faster.
2. Just look how it finds a word, it uses INSTR() ONCE because we enclose the word with a chr$(10) at front and a Chr$(9) on end to guarantee the words we find are the first on any line of Collins.txt file.
It does use INSTR() again just to find the end of that particlar line. So there is no playing of the guessing game that we do with an RA file. It's pretty cool efficiency wise.
b = b + ...