Hello Tempo - love that handle
I'm not sure how you were able to add "Next" to Resume. When I try that I get an error. The best I seem to be able to do is use Resume or Return in the error handling routine but it actually doesn't resume or return to the program. My actual program is over closing in on 13000 lines, so there is likely something going on in there which is creating more of an adverse effect than the following code provides. In my actual program I do not not get the Error box which states "Return without a Gosub" and the choice to "continue or not". I just get the empty white box and a frozen computer.
But here is an example of the coding in my program. When you run this you get the Error Handling routine working but in the actual coding, after the error trapping is a further PRINT statement or 2. I'm expecting the Error Handling routine to pass the run back to continue the run of the program and eventually PRINT out the array. That example coding here ends the run.
DIM TestArray(1 TO 50, 1 TO 45)
FOR x = 1 TO 50
a = a + 1
FOR y = 1 TO 45
b = b + 1
TestArray(x, y) = TestArray(x, y) + (a + b)
NEXT y
NEXT x
FOR x = 1 TO 50
FOR y = 1 TO 44
ON ERROR GOTO HandlingTestArray
TotalTestArray(x, y) = TotalTestArray(x, y) + TestArray(x, y)
WRITE #1, TestArray(x, y)
ON ERROR GOTO 0
NEXT y
NEXT x
CLOSE 1
FOR x = 1 TO 50
FOR y = 1 TO 45
PRINT "Total Value of the Array is now "; TotalTestArray(x, y)
NEXT y
NEXT x
END
HandlingTestArray:
CLS
SCREEN _NEWIMAGE(1200, 800, 32)
_FULLSCREEN
PRINT "Error is "; ERR
PRINT "Error line is "; _ERRORLINE
PRINT
PRINT
PRINT "The Error involves x equaling "; x; " and y equaling "; y; " placing the value of "; TestArray(x, y); " in TestArray("; x; ","; y; ")"
SLEEP
'RESUME
RETURN