• 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: is Shane's advice being collated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is Shane's advice being collated?


  • Subject: Re: is Shane's advice being collated?
  • From: 2551 <email@hidden>
  • Date: Thu, 20 Nov 2014 12:53:19 +0700

> On 20 Nov 2014, at 09:51, Shane Stanley <email@hidden> wrote:
>
> So for lurkers, the difference is something like:
>
> if x = y then
>
> vs:
>
> if (x's isEqualToString:y) as boolean
>
> Less typing, but I don't know that it's significantly "easier".


When doing comparisons of hard-coded strings against strings returned from methods, AppleScript's "=" handles any null-termination for you automatically, ignoring the terminating character, whereas isEqualToString: doesn't.

That means if you're comparing two strings in Cocoa and you don't know whether one, both or neither might be null-terminated, you have to write extra code to account for that.


 _______________________________________________
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


References: 
 >Re: is Shane's advice being collated? (From: Charles Arthur <email@hidden>)
 >Re: is Shane's advice being collated? (From: Shane Stanley <email@hidden>)
 >Re: is Shane's advice being collated? (From: 2551 <email@hidden>)
 >Re: is Shane's advice being collated? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: is Shane's advice being collated?
  • Next by Date: Re: is Shane's advice being collated?
  • Previous by thread: Re: is Shane's advice being collated?
  • Next by thread: Re: is Shane's advice being collated?
  • Index(es):
    • Date
    • Thread