• 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: Don't test s="" [was Re: Strange string test error]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't test s="" [was Re: Strange string test error]


  • Subject: Re: Don't test s="" [was Re: Strange string test error]
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 12 Dec 2002 12:30:33 -0800

On 12/12/02 12:21 PM, I wrote:

> On 12/12/02 11:56 AM, "Emmanuel" <email@hidden> wrote:
>
>> I just restate the conclusion of the latest posts, so that it be
>> clear for as many people as possible:
>>
>> Do not test for an empty string:
>>
>> ----------------------
>> if (s = "") -- don't do that
>> ----------------------
>>
>> unless you know for sure that s is a shorter string than 32K.
>>
>> Instead, test for a null length, it's safer.
>>
>> ----------------------
>> if (s's length = 0) -- do that instead
>> ----------------------
>
>
> I've forgotten about 'contains': can you search for a substring in a
> string that's longer than 32K?



You can't: it gives a false negative (not an error), even if the substring
is near the beginning. Yucch.

--
Paul Berkowitz
_______________________________________________
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.

References: 
 >Don't test s="" [was Re: Strange string test error] (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Don't test s="" [was Re: Strange string test error]
  • Next by Date: Scope
  • Previous by thread: Re: Don't test s="" [was Re: Strange string test error]
  • Next by thread: i-cal
  • Index(es):
    • Date
    • Thread