[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| RETRY |
+---------------------------------+
RETRY
-----------------------------------
Re-executes previous command.
-----------------------------------
The RETRY command returns control to the calling program and re-executes
the last line that was executed in that program. The RETRY command is
similar to the RETURN command except that the RETURN command causes the
next line in the calling program to be executed rather than re-executing
the most recently executed line.
RETRY is especially useful when a set of commands should be repeated
until a certain condition is true, or in error handling routines.
With FoxPro/LAN, the network version of FoxPro, the RETRY command is
frequently used to RETRY a command until a record or file becomes
available for use. The SET REPROCESS command may optionally be used to
control the retries of a command that was unable to access a record or
file. In most network situations the SET REPROCESS command is
preferred.
+---------------------------------+
| Program Example |
+---------------------------------+
In this example, records from CUSTOMER database are printed. If error
occurs, PROCEDURE named STOP is executed. STOP displays WAIT message to
check printer and when key is pressed program attempts to RETRY command
which caused error to occur.
CLOSE ALL
SET ESCAPE ON
SET TALK OFF
USE customer
CLEAR
ON ERROR DO stop
SET DEVICE TO PRINTER
SCAN
@ PROW()+1,10 SAY 'Company: ' + company
ENDSCAN
SET DEVICE TO SCREEN
ON ERROR
PROCEDURE stop
IF ERROR() = 125
WAIT WINDOW 'Please check your printer'
SET DEVICE TO PRINTER
RETRY
ENDIF
RETURN
-----------------------------------
See Also: ON ERROR, RETURN, SET REPROCESS
-----------------------------------
See Also:
ON ERROR
RETURN
SET REPROCESS
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson