qb45advr.hlp (Topic list)
RESUME Statement Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
RESUME Statement Programming Example
 
This example has an error-handling routine starting at line 900 which
traps negative arguments to the SQR function.
 
5 CLS
10 ON ERROR GOTO 900
20 FOR I = 4 TO -2 STEP -1
30     PRINT I, 1 - SQR(I)
40 NEXT
50 END
 
900 'Error-handling routine
910     PRINT "No negative arguments"
920 RESUME NEXT
 
Sample Output
 
4      -1
3      -.7320509
2      -.4142136
1       0
0       1
-1      No negative arguments
-2      No negative arguments