Re: Sorting characters of the text - script doesn't work as expected
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