Blank textbox.text value

Cableguy

Expert
Licensed User
Longtime User
How to trap a blank textbox.text value?

I have tryed "" but it doesn work...

I need a textbox.text to BE something starting with a letter!
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Hello CableGuy,

This works for me....
B4X:
Sub Globals

End Sub

Sub App_Start
   Form1.Show
End Sub

Sub Form1_MouseDown (x,y)
 If TextBox1.Text="" Then
 MsgBox("Works")
 End If
End Sub

Just add a TextBox1 with no text to From1 and try for yourself.
I fear that you must be doing something else wrong.

Regards,
RandomCoder
 

Scubaticus

Active Member
Licensed User
How to trap a blank textbox.text value?
I have tryed "" but it doesn work...
I need a textbox.text to BE something starting with a letter!

This works, but a trim would be very handy ;)

x = strLength (txtString.Text)
y = " " (lot of space chars)


if (txtString.Text = "") Or ( subString(txtString.Text,0, x) = subString(y,0,x) ) then String has all spaces or is empty

Scub
 

Cableguy

Expert
Licensed User
Longtime User
Thanks Guys

I fear that you must be doing something else wrong.

You were right, I was testig for textbox.text = "" when I should be testing for textbox.text <> ""

Thats what happens when you try to code for 4 hours stright....ending at 1AM...:sign0013:
 

Scubaticus

Active Member
Licensed User
.. code for 4 hours stright ..

When I told you how many hours I'm behind my screen.... I never had a PPC but want to archive fishing details (including GPS tracking etc.). Now I have a PPC and B4ppc and want to finish my program. For me it's Work-B4ppc-Sleep and repeating since the last week :sign0148:

But it's a lot of fun!

So for all my stupid questions the next few days :sign0013:

Scub
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Originally Posted by Cableguy
Thats what happens when you try to code for 4 hours stright....ending at 1AM...

You lightweight ;)

Regards,
RandomCoder.
 
Top