• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: greater than AND less than
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >greater than AND less than (From: Sean Malone <email@hidden>)

  • Prev by Date: Re: Scripting Internet Explorer 5.0's preferences
  • Next by Date: [ANN] Smile 1.8.3 available.
  • Previous by thread: greater than AND less than
  • Next by thread: Re: greater than AND less than
  • Index(es):
    • Date
    • Thread