16-07-2007, 07:06 PM
Better way to do this would be to check for a period AFTER the @, otherwise "glacier86.99@bellsouth" would return true.
Rough idea:
Used the PHP "return false," but you get the idea.
Rough idea:
Code:
Dim i As Byte, a As Byte, c As Byte
For i = 1 To Len(Text1.Text)
If Mid(Text1.Text, i, 1) = "@" Then
'Adding 2 will prevent email@.com
a = a + 2
For c = a To Len(Text1.Text)
If Mid(Text1.Text, c, 1) = "." Then
Return True
End If
Next c
' Didn't find the period, return false.
Return False
End If
Next i