B+: Check for nothing but spaces.. How?

Blitz3D Forums/Blitz3D Beginners Area/B+: Check for nothing but spaces.. How?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hey,

I need to do a check on a TextField, to see if something was typed there or not. My program will not allow to use the TextField, if nothing visible is typed. That could be nothing typed at all, or a bunch of spaces.. I can't thing of a way to do this, other than this clumsy way:

Function CheckFor50spaces()
   If TextFieldText$(SiteNameField)=("") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=(" ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("  ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("   ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("    ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("     ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("      ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("       ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("        ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("         ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("          ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("           ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("            ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("             ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("              ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("               ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                 ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                  ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                   ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                    ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                     ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                      ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                       ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                        ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                         ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                          ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                           ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                            ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                             ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                              ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                               ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                 ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                  ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                   ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                    ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                     ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                      ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                       ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                        ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                         ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                          ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                           ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                            ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                             ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                              ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                               ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                                ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                                 ") Then Notify "You MUST give it a name!" : NoName=True : Return
   If TextFieldText$(SiteNameField)=("                                                  ") Then Notify "You MUST give it a name!" : NoName=True : Return
End Function


So far, I check up to 50 spaces. But if there are 51 spaces in the TextField, it will be allowed, and I don't want that!! Is there a way to check a TextField for nothing, OR ANY amount of spaces..?