>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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement