Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try Catch with Catch 2 times
Message
From
01/06/2021 07:17:25
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680817
Message ID:
01680865
Views:
53
Likes (1)
>Hi,
>
>Could someone create a sample code with Try Catch such that Try will trigger an error and then Catch will trigger an error such that it would go back to the Catch again? That is, where the Catch code fires twice. I have had that condition once (I saw it in the debugger) but forgot how the error in my code triggered it.
>

Also worth noting that you can have multiple Catch clauses in a single Try-Catch if they use the When clause:
TRY 
  * Something
CATCH TO oExc WHEN oExc.ErrorNo = n
  * One response for a special case
CATCH TO oExc WHEN oExc.ErrorNo = m
  * Different response for a different special case
CATCH
  * The rest of the cases
ENDTRY
Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform