Re: greater than AND less than
Re: greater than AND less than
- Subject: Re: greater than AND less than
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Sun, 26 Aug 2001 06:49:40 -0500
on 8/26/01 3:38 AM, Sean Malone at email@hidden wrote:
>
If finalAverage is greater than 92.65 or is less than 96.45 then...
Be careful with that expression. Using "or" will return a true as long as
one side evaluates to true.
For example:
set finalAverage to 64.5
finalAverage is greater than 92.65 or finalAverage is less than 96.45
--> true (because it *is* less than 96.45)
set finalAverage to 97.5
finalAverage is greater than 92.65 or finalAverage is less than 96.45
--> true (because it *is* greater than 92.65)
Now try the *and* operator (both parts of the expression must evaluate to
true in order to return true)
set finalAverage to 64.5
finalAverage is greater than 92.65 and finalAverage is less than 96.45
--> false
set finalAverage to 97.5
finalAverage is greater than 92.65 and finalAverage is less than 96.45
--> false
set finalAverage to 94.5
finalAverage is greater than 92.65 and finalAverage is less than 96.45
--> true
Note that I made a call to the variable "finalAverage" in the 2nd part of
the expression for my examples.(Your line wasn't doing that which is
probably why it wasn't working for you.)
At any rate, that should help some, but I hope that others will provide far
better solutions and examples.
cheers
bob.kalbaugh