Or you could use an ON ERROR statement to trap the "Out of DATA" error which will inevitably occur. Here's an example lifted directly from something I wrote:ERR is a BASIC pseudo-variable giving the most recent error number, and 42 represents "Out of DATA" (if your User Guide is not to hand and you have not memorised them, you can always create an error deliberately and check ERR immediately afterwards) which is the condition we are expecting and able to handle. The code to do so begins at line 480. If any other error occurred, it must be a real one; so we close all open files (in case the error had something to do with a file access), display the error message and bow out gracefully.
Code:
110 ON ERROR IF ERR=42 GOTO 480 ELSE CLOSE#0:REPORT:PRINT" at line ";ERL:END
Statistics: Posted by julie_m — Mon Nov 18, 2024 11:57 pm