Sorry, stuff came up.
What I meant was could you show the code that precedes and follows line 111.
The reason I ask is because if you see "Out of data" that can either means that there's not enough data for what is intended, or READ is called too many times than what is necessary.
I think you need to change the 19s on lines 95 and 97 to MAPH%-1 and MAPW%-1 respectively. This will limit the amount of READs done.
So instead of...
FOR FORY%=0 TO 19
FOR FORX%=0 TO 19
...write this...
FOR FORY%=0 TO MAPH%-1
FOR FORX%=0 TO MAPW%-1
Ok i just now tried the stuff you guys told me and it worked but here's the problem, i made the array 7 line higher and it says subscript out of rage in 421
and program doesn't even have 420 lines O_o and i put MAPH%+7