Read the same line where an exception is raised

We can read a line that cannot be read correctly because of disagreement of types or shortage or excess of the number of data again using SET #n POINTER SAME.

Example.

100 OPEN #1:NAME "A:abc.txt"
110 DO
120    WHEN EXCEPTION IN
130       INPUT #1,IF MISSING THEN EXIT DO: a,s$
140       PRINT a,s$
150    USE
160       SET #1:POINTER SAME
170       LINE INPUT #1:t$
180       PRINT "error",t$
190    END WHEN
200 LOOP
210 END

Back