Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to use AND/OR in an If statement? 1

Status
Not open for further replies.

weezles

Technical User
Jul 18, 2003
81
GB
Hi

I was wondering if its possible to use an AND/OR type thing in vb within an If statement?

eg If this is True and/or this is True then
do this
End If

Lou
 
Remember that AND and OR in VB obey normal precedence rules for logic. This means that...

A AND B OR C

is the same as...

(A AND B) OR C

not...

A AND (B OR C)

The calculation in the brackets comes first. Better still use brackets like bjd4jc to make it clear what you mean.

This is actually VB.NET but its the same rules...


Boggg1
[bigglasses]
 
JohnYingling is correct and/or is logically meaningless."
Thanks...Hey wait a minute. Is that statement missing some punctuation or are you saying I am logically meaningless in addiotion to being correct.
"JohnYingling is correct: "and/or" is logically meaningless.
[spineyes]

Forms/Controls Resizing/Tabbing
Compare Code
Generate Sort Class in VB
Check To MS)
 
[lol]

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top