• 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: Since Apple Listens to this List... [Case Statements]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Since Apple Listens to this List... [Case Statements]


  • Subject: Re: Since Apple Listens to this List... [Case Statements]
  • From: email@hidden
  • Date: Mon, 11 Feb 2002 15:14:46 EST

Any nested if statement longer than a dozen if/elseif statements would
benefit in legibility from a case statement instead. Depending on the
structural requirements of the case statement (all comparison case entries
must be in ascending order if numeric, string, given more than a dozen
possible cases to compare to), there could even be a speed benefit, by
implimenting the case comparison as a shaker sort at the compiler.

A quick example that comes to mind is something that would compare entries in
a series of records to 100 possible nation-prefix area codes to determine the
time zone offset. Nesting 100 if/elseif statements would be a cludge at best.
You could use the whose statement, as suggested Bryan Kaufman in a separate
email (thanks!), but that doesn't change my personal wish for a case
statement more times than I care to admit :)

=-= Marc
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Since Apple Listens to this List... [Case Statements]
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: RE: Apple System Profiler in OS10.1.2 opens OS9.2
  • Next by Date: Re: Since Apple Listens to this List... [Case Statements]
  • Previous by thread: QXP PhotoBooks Sorting
  • Next by thread: Re: Since Apple Listens to this List... [Case Statements]
  • Index(es):
    • Date
    • Thread