Android Question case select dont works

fa_of

Member
tengo un problema con la condicion select case, comparo pero no funciona, adjunto mi codigo y una copia del programa que estoy trabajando

Sub txtSend_TextChanged (Old As String, New As String)
Select txtSend.text
Case "z"
Msgbox("sads","")
Case "a"
Msgbox("","")
Case " "
Msgbox("","")
End Select
End Sub
 

Attachments

  • codigo.txt
    9.6 KB · Views: 287

fa_of

Member
sorry
I have a problem with the condition select case, but does not work compare, attached my code and a copy of the program I'm working

Sub txtSend_TextChanged (Old As String, New As String)
Select txtSend.text
Case "z"
Msgbox("sads","")
Case "a"
Msgbox("","")
Case " "
Msgbox("","")
End Select
End Sub
 

Attachments

  • codigo.txt
    9.6 KB · Views: 274
Upvote 0

Theera

Expert
Licensed User
Longtime User
Hi fa_of,
you might use Erel's guide as picture.
 

Attachments

  • UsingRegex.png
    UsingRegex.png
    23.6 KB · Views: 373
Upvote 0

ddeckert

Member
Licensed User
Longtime User
It could be that it is a upper/lower case issue try this:

B4X:
Select lcase(txtSend.text)
Case "z"
Msgbox("sads","")
Case "a"
Msgbox("","")
Case " "
Msgbox("","")
End Select
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I think it needs to be like this in order for it to work
B4X:
Sub txtSend_TextChanged (Old As String, New As String)
Select New
Case "z"
Msgbox("sads","")
Case "a"
Msgbox("","")
Case " "
Msgbox("","")
End Select
End Sub

Hopefully it works like this
 
Upvote 0
Top