Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why TRY...CATCH…FINALLY not support RETRY ?
Message
From
11/08/2003 10:01:33
 
 
To
11/08/2003 03:51:05
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00818569
Message ID:
00818876
Views:
18
>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
Map
View

Click here to load this message in the networking platform