I'm searching for information on how to simulate a RETRY from within a TRY-CATCH block. In this made-up scenerio I want to do some processing. This includes opening a file. If I can't open the file I will process using an alternative file. Something like
TRY
some code
lcFile = MyGetFileRoutine()
USE (lcFile)
more code
CATCH
IF "can't open file"
lcFile = MyGetAlternateFileRoutine()
RETRY
ELSE
do the normal CATCH programming
ENDIF
ENDTRY
I know this is illegal since you can't use RETRY within a TRY-CATCH. So I tried
TRY
some code
lcFile = MyGetFileRoutine()
ON ERROR DO ResetFile
USE (lcFile)
ON ERROR
more code
CATCH
do the normal CATCH programming
ENDTRY
PROC ResetFile
lcFile = MyGetAlternateFileRoutine()
RETRY
But the ON ERROR does not fire.
I know I can re-code this particular example but.......
Is there any way to incorporate RETRY capability into a TRY-CATCH????
Thanks to all...........Rich