Android Question How do I exit a sub from within an if-then structure?

DTB Radio

Member
Licensed User
Longtime User
I'm just getting started with Basic4Android, and I'm finding that its just different enough from Visual Basic to trip me up here and there. Right now, I want to be able to exit a sub if a text box has improper input (or is blank). Here's what I tried:

B4X:
If text1.text = "" then
      exit sub
end if

This throws an error about a missing end sub statement. How do I exit a sub from within the if-then structure?
 
Top