|
-
Jul 2nd, 2000, 06:22 AM
#1
Thread Starter
Frenzied Member
In a textbox how do i test to see if it contains an '@' symbol '.com' and for a date to see if it has three '/' in it ??
-
Jul 2nd, 2000, 09:19 AM
#2
_______
..long winded but it will work..
Private Sub Command1_Click()
Dim myString As String
Dim myLen As Integer
Dim myAt As Boolean
Dim mySlash As Integer
Dim iCount As Integer
myAt = False
myString = Text1.Text
myLen = Len(myString)
For iCount = 1 To myLen
If Left(myString, 1) = "@" Then
myAt = True
End If
If Left(myString, 1) = "/" Then
mySlash = mySlash + 1
End If
myString = Right(myString, (myLen - iCount))
Next
If mySlash > 1 Then MsgBox "Yes, 2 or more / are involved."
If myAt = True Then MsgBox "Yes, there is an @ involved."
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 2nd, 2000, 09:30 AM
#3
transcendental analytic
Like is the fastest known operator!
Code:
IF text1 like "*@*" then Msgbox "@ involved"
IF text1 like "*.com*" then Msgbox ".com involved"
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 2nd, 2000, 09:36 AM
#4
transcendental analytic
Sorry i forgot the /'s well Hesaidjoe knows how to use instr, but this one will count them to 3, not 2 or more
Code:
a=instr$(text1,"/")
Do while a
counter=counter+1
a=instr$(a+1,text1,"/")
loop
if counter=3 then msgbox "text1 has three / in it"
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 2nd, 2000, 09:38 AM
#5
Thread Starter
Frenzied Member
Thanks guys, just what i needed, i'll try the shorter method first !!!!!
-
Jul 2nd, 2000, 09:42 AM
#6
_______
?
I could count to 3 but I couldn't see where there are
3 {/} in a date expression..I assume looking for 3 was a typo
2000/07/02
therefore if it's > 1 the possibilities are it's correct.
assuming of course that the text1 text isn't something
like this
I came home/work and found my beer@mydesk/table was missing.
LOL
PS
I like the like (it works extremely well)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 2nd, 2000, 09:56 AM
#7
transcendental analytic
LOL
Sorry about that HeSaidJoe 
if counter=2 ...
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 2nd, 2000, 10:02 AM
#8
_______
///
kedaman
not a problem.
Have a good one...gone out to enjoy the day!
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|