Error Label

Cableguy

Expert
Licensed User
Longtime 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...

B4X:
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
 

Cableguy

Expert
Licensed User
Longtime User
Yes i saw that but my problem is that this particular sub is the app_close...wont this cause another endless loop?
 

specci48

Well-Known Member
Licensed User
Longtime User
The elegant way... ;)

B4X:
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!
 

specci48

Well-Known Member
Licensed User
Longtime User
Additional question:

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


specci48
 

Cableguy

Expert
Licensed User
Longtime 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:
 
Top