A text file implemented in a rom? Or a rom implemented in a text file? And that was a serious question, given that this is a textbench question. For all I know this is a chinese whispers implementation of a testbench for a rom where the rom content is read from a file on your local friendly file system.
And if you really meant "text file implemented in a rom", what makes it a file instead of a regular boring old chunk of data in rom? Does it have a file header? Is there a file system stored on that rom?
Quick check of code ... "FILE romfile : text is in RomFileName;" .... aaah, chinese whispers it is. You say "A text file implemented in a rom" but you mean to say "A rom implemented in a text file". got it.
As for the for loop, I dunno. You just have a for loop that essentially is a counter looping over all the ROM addresses, then read the rom, and do some clever testbenchy verify-ey stuff with the data you just read from your rom?