|
-
Nov 4th, 1999, 07:48 AM
#1
Thread Starter
Junior Member
I will probably get laughed out of this forum but I need to know how to check for more than on thing in an IF statement.
Ex. if richtextbox1.text = ^6,^7,^8,^9 then
whatever...
I don't want to have to nest if statements if at all possible. Please help.
GiD
-
Nov 4th, 1999, 07:56 AM
#2
Fanatic Member
You could use OR Operator.
Code:
With Text1
If .Text = "^6" Or .Text = "^7" Then
'Do whatever you want
End If
End With
'you don't have to use With statement
'it just makes code look less
'complicated to me (and shorter too)
Hope this will help
------------------
Visual Basic Programmer
-----------------
PolComSoft
You will hear a lot about it.
[This message has been edited by QWERTY (edited 11-04-1999).]
-
Nov 4th, 1999, 07:58 AM
#3
Junior Member
Use OR keyword.
If something = "BLAH" or something = "MORE BLAH" Then
do something.
End if
If you can multiple different cases you want to check you can also user Select Case.
SELECT CASE richtextbox1.txt
CASE 1
do something
CASE 2
do something
CASE 6,7,8,9
do something
END SELECT
-
Nov 4th, 1999, 08:44 AM
#4
Thread Starter
Junior Member
Thanks a lot guys. I had a brain fart there! 
GiD
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
|