Re: Since Apple Listens to this List... [Case Statements]
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.