Skip to content

RETRY

Retry Statement That Caused Error Branch

This directive transfers program execution from an error branch taken by a SETERR directive or the ERR=, END=, or DOM= options, back to the statement that generated the error and attempts to execute it again.

RETRY

If the error branch was controlled by a SETERR directive, the actual error resets the SETERR program line number to 00000; RETRY resets the program line number or label back to the value specified by the SETERR.

This directive can only be used in Thoroughbred Basic Run Mode, not in Thoroughbred Basic Console Mode.

00010 SETERR 00100
00020 READ (2) A
00030 PRINT A
. . .
00100 PRINT "ERR=", ERR
00110 RETRY

If an error occurs during the execution of statement 00020, a branch to statement 00100 is taken and the RETRY directive returns execution to statement 00020 and resets the SETERR statement number to 00100.

00020 READ (2, ERR=00100) A
. . .
00100 PRINT "ERR=", ERR
00110 RETRY

has the same effect as the first example, but the branch is directed by the ERR= option and the RETRY directive returns execution to statement 00020.

From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF