Errors in code blocks?

agraham

Expert
Licensed User
Longtime User
Question for Erel.

If you recall Klaus had a problem with some legacy code that jumped around, using Goto, inside For..Next and If..End If code blocks. You said that this was the cause of his problem and it was. The thought occurs to me about what happens if, using ErrorLabel(), an error occurs in such a code block and execution jumps to the error label. As this seems equivalent to a Goto does B4PPC handle this properly. It certainly seems to.

If it IS handled gracefully can the error label code safely be outside the code block, typically before the End Sub and preceded by a Return statement?
 
Top