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.

Isn't that what you want to do?
Function CheckForspaces()
    txt$=TextFieldText$(SiteNameField)
    ln% = Len(txt)
	For i = 1 To ln
		If Mid(txt, i, 1) <> " " Then
			NoName = False
			Return
		EndIf
	Next	
	Notify "You MUST give it a name!"
	NoName=True
End Function

(I have supposed NoName is a global variable.)

Or even simpler:
Function CheckForspaces()
    txt$=TextFieldText$(SiteNameField)
    NoName = (Trim(txt) = "")
    If NoName Then Notify "You MUST give it a name!"
End Function