• 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
if clauses: multiple values in one test?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

if clauses: multiple values in one test?


  • Subject: if clauses: multiple values in one test?
  • From: Mikael Byström <email@hidden>
  • Date: Sun, 21 Sep 2003 00:34:38 +0200

How can I shorten a long line of nearly identical tests, except for the
value it tests against, in an if clause?
Say I have
"if (FileName ends with "X") or (FileName ends with "Y") or (FileName
ends with ".Z")....... (*plus 26 more or so*)
then"

Can I use an array of string values instead and have them all in only one
test? How can I express that in this situation?
Or can I at least write "with x or y or z" or similar in a simple way?
_______________________________________________
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: if clauses: multiple values in one test?
      • From: Christopher Stone <email@hidden>
    • Re: if clauses: multiple values in one test?
      • From: Walter Ian Kaye <email@hidden>
    • Re: if clauses: multiple values in one test?
      • From: Paul Berkowitz <email@hidden>
    • Re: if clauses: multiple values in one test?
      • From: Matthew Smith <email@hidden>
  • Prev by Date: Re: How can I display a dialog in one non-main thread?
  • Next by Date: Re: if clauses: multiple values in one test?
  • Previous by thread: Re: POST Data
  • Next by thread: Re: if clauses: multiple values in one test?
  • Index(es):
    • Date
    • Thread