ThRuST Well-Known Member Licensed User Longtime User Nov 17, 2016 #1 This question could possible be posted in any of the other forums but I try here. Might seem simple but this got me puzzled: How to check if textfield is empty or not? I have tried B4X: If textfield.text !="" then code... End If But that didn't work. I think that worked in VB.NET years ago... Last edited: Nov 19, 2016
This question could possible be posted in any of the other forums but I try here. Might seem simple but this got me puzzled: How to check if textfield is empty or not? I have tried B4X: If textfield.text !="" then code... End If But that didn't work. I think that worked in VB.NET years ago...
ThRuST Well-Known Member Licensed User Longtime User Nov 17, 2016 #2 I solved it myself this way B4X: If textfield.Text = "" Then Return Else code... End If If you know a simpler way let us know Last edited: Nov 19, 2016 Upvote 0
I solved it myself this way B4X: If textfield.Text = "" Then Return Else code... End If If you know a simpler way let us know
S Squiffy Active Member Licensed User Longtime User Nov 17, 2016 #3 I believe the correct way to check for not equal to is : B4X: If textfield.Text <> "" Then Upvote 0
Cableguy Expert Licensed User Longtime User Nov 17, 2016 #4 plenty ways to check that, both above are correct, and you could even do it like B4X: If TextField.Text.length<>0 then But then again, a space would make it true Upvote 0
plenty ways to check that, both above are correct, and you could even do it like B4X: If TextField.Text.length<>0 then But then again, a space would make it true
ThRuST Well-Known Member Licensed User Longtime User Nov 17, 2016 #5 Yay, both ways works fine. But I personally like Squiffys way but Cableguys solution was kinda clever too. It was good to refresh our memory on this, simple matter Thanks Upvote 0
Yay, both ways works fine. But I personally like Squiffys way but Cableguys solution was kinda clever too. It was good to refresh our memory on this, simple matter Thanks