Android Question For-Next-Exit

Giusy

Active Member
Licensed User
Hi,
I have a button called "STOP" when I press it I want to get out of For and Next

B4X:
Fox x = 1 to 100
   .....
   .....
???? <----  the button "Stop" has been pressed and then Exit
   .....
next
It will be very simple for you, but I do not know how to intercept the button :(
Thank you
 

Star-Dust

Expert
Licensed User
also
B4X:
For x = 1 to 100
   .....
   .....
   Sleep(1)
   If ExitVariabile=true then X=101
   .....
next
 
Upvote 0

Giusy

Active Member
Licensed User
This code will complete in about 1ms. TTS.Speak is not a blocking call (with the exception of the deprecated modal dialogs, there are no blocking methods).

The correct answer is:
B4X:
Sub Button1_Click
 tts.Stop
End Sub
Thank you :D
 
Upvote 0
Top