• 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: Sorting characters of the text - script doesn't work as expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting characters of the text - script doesn't work as expected


  • Subject: Re: Sorting characters of the text - script doesn't work as expected
  • From: "Nigel Garvey" <email@hidden>
  • Date: Sat, 27 May 2017 10:25:54 +0100

Brian Christmas wrote on Sat, 27 May 2017 03:14:23 +1000:

>Yvan, I’ve found comparisons of a variablr to ‘{}’ often fail.

This is rather a vague statement since it doesn't define "fail",
"comparison", or what's in the variable. Any comparison other than for
equality will error. An equality comparison will give the correct
result, but possibly not the one expected if you think the variable
contains a list when it actually contains a reference.

>What I prefer is
>
>if count of LithuanianRecords is not 0 then

This avoids the reference ambiguity, although pedantically, 'count' is a
command, not a property, so the 'of' is technically incorrect. I think
too (although I may be wrong) that 'is not' is a two-stage process in
AppleScript (equality test, negation of the result), so where it doesn't
have the code disappearing up its own backside, I'd personally use:

  if ((count LithuanianRecords) > 0) then


NG
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Sorting characters of the text - script doesn't work as expected
  • Next by Date: assistive access weirdness
  • Previous by thread: Re: Sorting characters of the text - script doesn't work as expected
  • Next by thread: Re: Sorting characters of the text - script doesn't work as expected
  • Index(es):
    • Date
    • Thread