I dont know what this "SUB" is but $chr(26) is the EOF (end of file) marker character, so i can sure see why the file is seen to have ended.

I dont aggree with this being the correct thing that should be done but i beleive that is the reason.

I wonder if it is mirc or maybe an under lying compiler code problem or even the OS method used to access the file?