Errors in code blocks?

Discussion in 'Questions (Windows Mobile)' started by agraham, Nov 22, 2007.

  1. agraham

    agraham Expert Licensed 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?
  2. Erel

    Erel Administrator Staff Member Licensed User

    ErrorLabel target should be outside any code block (before the End Sub is a perfect place).
    ErrorLabel does handle errors inside code blocks and will jump properly to a label outside the code block.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice