Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try Catch with Catch 2 times
Message
 
 
To
01/06/2021 07:17:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680817
Message ID:
01680866
Views:
43
>>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

I didn't know about this clause. This should really help in troubleshooting issue(s).
Thank you!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform