Error Label

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Jun 28, 2007.

  1. Cableguy

    Cableguy Expert Licensed User

    Hi...Again....:sign0161:

    Ok my endless loop is sorted out thanks to Dzt input and thoughts....but i have another problem...

    How do i exit the sub before the errorlabel?

    Maybe it will be cleared with some code...

    Code:
    Sub Dummy
    Errorlabel(error)
    oranges=
    3
    if oranges 0 2then aples =5
    [COLOR=
    "Red"]'How to exit the sub HERE? If no error is detected the code below is executed anyway![/COLOR]
    error:
    Bananas=
    10
    End Sub
    Thanks
     
  2. dzt

    dzt Active Member Licensed User

    Goto
    code...
    label:

    .. and Return

    See b4ppc help
     
  3. Cableguy

    Cableguy Expert Licensed User

    Yes i saw that but my problem is that this particular sub is the app_close...wont this cause another endless loop?
     
  4. specci48

    specci48 Well-Known Member Licensed User

    The elegant way... ;)

    Code:
    Sub Dummy
        Errorlabel(error)
        oranges=
    3
        
    if oranges 0 2then aples =5
        
    'How to exit the sub HERE? If no error is detected the code below is executed anyway!
        [B]Return[/B]
        error:
            Bananas=
    10
    End Sub

    specci48


    :signOops:
    I haven't seen the Return by dzt ... sorry!
     
  5. specci48

    specci48 Well-Known Member Licensed User

    Additional question:

    Why are you afraid of a loop? After the sub is finished, AppClose is not executed again.


    specci48
     
  6. Cableguy

    Cableguy Expert Licensed User

    Ok

    I tryed RETURN and it worked fine....

    I was afraid that returning to thesub that called it, being it the same sub it was on, would cause an endless loop...

    I was wrong...:sign0013:

    An Yes, I do:sign0012:

    :sign0152:
     
Loading...
  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