View Single Post
  #2 (permalink)  
Old March 12th, 2008, 03:39 PM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I think you are misunderstanding the logic of the OR operator.

If x gets populated with 'a'
x <> "a" will evaluate to false and processing continues onto the other side of the OR operator
x <> "b" will evaluate to true which causes your response statement to execute.

If x gets populated with 'b'
x <> "a" evaluates to true so the other side of the OR operator is not evaluated and your response statement is executed.

With the OR statement, only one side of the OR needs to evaluate to true for the entire evauation to be true.

So if you want x to not equal either a or b use the AND operator:
If x <> "a" and x <> "b" then 'do stuff


hth


================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote