>Hi Garrett,
>
>VFPT put this limit because:
>- TRY... is a stacked error handling structure,
>and implement RETRY is hard ( but not impossible ).
>
>I have found on www other articles where this VFP lack is analyzed, but
>none have found a simplified solution, all have found a more complex
>solution ( merge TRY... and ON ERROR ).
>
>My affirmation:
>
>"But because TRY... have priority, if i want use retry, i must renounce to TRY...."
>
>This last affirmation is true?
>
>Fabio
Procedure KeepTrying
LOCAL nRetryLimit, nRetryCount
nRetryLimit = 100
nRetryCount = 1
DO WHILE (NOT DoThing()) OR nRetryCount < nRetryLimit
nRetryCount = nRetryCount + 1
ENDDO
FUNCTION DoThing
LOCAL lSuccess
lSuccess = .F.
TRY
* Do your thing
lSuccess = .T.
CATCH
* Didn't work
ENDTRY
RETURN lSuccess
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only