Directives
RETRY Re-Execute Failing Instruction
 
Format RETRY
 
Description The RETRY directive returns control to the statement on which the last error transfer occurred. This allows you to take corrective action and retry the statement. Use
*RETRY to emulate this directive in a statement reference. See Labels/Logical
Statement References.
If an error occurs on a statement where you have used any of the ERR=, DOM= or END= options, or where you have used a SETERR directive, ProvideX does the following:
 
• Saves the statement number and directive where the error occurred (as a retry address).
 
• Passes control to the file option or SETERR statement reference to handle the error.
 
• Returns control to the RETRY directive using the retry address.
 
You can find the currently saved retry address or line reference in TCB(11). ProvideX
returns Error #27: Unexpected or incorrect WEND, RETURN, or NEXT
(i.e., no return address on an error) if it encounters a RETRY directive with no previous statement saved.
The saved statement number and directive are cleared by any of the following directives: BEGIN, CLEAR, LOAD, RESET, START. You can also clear the retry address by executing a RUN directive with a program name specified.
When you use it in a compound statement, the RETRY directive must be the final directive. As of Version 4.20, if you set 'RR', ProvideX will also perform a reset for RUN directives.
 
See Also RESET Reset Program State
TCB( ) Function
'RR' System Parameter.
 
Example 0010 OPEN (1)"CUSTFL"
0020 INPUT (0,ERR=1000)"Enter customer number: ",C
0030 READ (1,ERR=1010,KEY=STR(C:"000000"))C$,N$
0040 PRINT C$," ",N$
0050 STOP
1000 PRINT 'RB','LF',"Invalid customer. "; RETRY ! Ring bell, retry 0020
1010 PRINT 'RB',"Cannot find customer: "; GOTO 0020
-:run
Enter customer number: 123987
Cannot find customer: Enter customer number: ABC Invalid customer.
Enter customer number: 123456
123456 ABC MFG