Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRY...CATCH...FINALLY to reprocess some code
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345690
Message ID:
01346188
Views:
8
What if it fails inside of Block and an error handler pick up an error? will it still work in the way you are showing?

>Hi Mark,
>
>Yes, you could run it several times like this:
>
>For lnAttempt = 1 to 10
>	Try
>		llDone = .F.
>		* Block start
>		? m.lnAttempt
>		If m.lnAttempt < Rand()*10
>			Error 1
>		EndIf
>		* Block end
>		llDone = .T.
>	Catch
>	EndTry
>	If m.llDone
>		Exit
>	EndIf
>EndFor
>
>However, if there's a problem it might be better to find out what is causing the problem and why you get an error, at all.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform