64. Error reporting ~~~~~~~~~~~~~~~ This is a little routine which not only reports errors in your programs, but also lists the offending line ready for you to edit. The first listing given only works on Basic version 2 and later, including BAS128, so if you aren't sure which you've got, press , and then type REPORT . Version 1 is copyright 1981, and version 2 is copyright 1982, etc.. If you have version 1, or you want the program to be compatible with versions 1 as well as later ones, then alter the two lines shown underneath, (10025 is an extra one), and it will then work OK on them all, though not on BAS128. All you have to do is add the routine before debugging your program, and make the very first line ON ERROR GOTO 10000. Of course, there is nothing magic about line 10000, so you can renumber the routine higher if you wish. In the example below, you should get the error "No such variable at line 100", as A$ hasn't been defined. Be very careful not to make mistakes when typing the routine; the listing should be copied exactly as shown, even if it looks rather odd, but you may omit all spaces if you wish. If you are debugging a listing from a magazine, miss out any other ON ERROR statements until you have finished. If you get into trouble, then press , type OLD , and you should get your program back. If you don't want to exit from the program when is pressed, then alter the number 10050 in line 10000 to the line where you do want the program to got to. You will find that this routine can save you a great deal of time in the long run. 10 ON ERROR GOTO 10000 100 PRINT A$:END:REM (Spot the deliberate mistake!) 10000 IF ERR=17 THEN 10050:REM (or other line number) 10010 MODE7:REPORT:PRINT" at line ";ERL':*FX15,0 10020 err$="L."+STR$(ERL)+CHR$(11)+CHR$(13) 10030 FOR bit%=1 TO LEN(err$) 10040 OSCLI("FX138,0,"+STR$(ASC(MID$(err$,bit%,1)))):NEXT 10050 END Make the following changes only if compatibility with Basic-I is important. 10025 DIM X% 12:Y%=X% DIV 256:REM For Basic-1 10040 $X%="FX138,0,"+STR$(ASC(MID$(err$,bit%,1))):CALL &FFF7:NEXT