• 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: How do you check the equivalency of references?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you check the equivalency of references?


  • Subject: Re: How do you check the equivalency of references?
  • From: Arthur J Knapp <email@hidden>
  • Date: Tue, 07 Aug 2001 18:04:20 -0400

> Date: 7 Aug 2001 13:06:36 -0400
> Subject: Re: How do you check the equivalency of references?
> From: "Anthony Adachi" <email@hidden>

> I've searched the applescript mailing lists for threads on the 32k limit of
> strings. While I've found much on how to munge strings of that length I'm
> having a hard time finding anything on how to compare strings that reach
> those limits.

-- Very quickly thrown together, so please check my work:

property kStringCompareLimit : 32000

to StringsAreEqual(strA, strB) --> true/false

set {lenA, lenB} to {strA's length, strB's length}

if lenA is not lenB then
return false -- unequal lengths, not same

else if lenA < kStringCompareLimit then
return strA = strB

end if

set x to 1

repeat (lenA div kStringCompareLimit) times

if strA's text x thru (x + kStringCompareLimit - 1) = ,
strB's text x thru (x + kStringCompareLimit - 1) then

set x to x + kStringCompareLimit
else
return false
end if
end repeat

if x > lenA then -- testing complete
return true
end if

if strA's text x thru -1 = strB's text x thru -1 then

return true
else
return false
end if

end StringsAreEqual



Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
http://homepage.mac.com/richard23/


  • Prev by Date: FWIW: Netscape register viewer and "archives"
  • Next by Date: Re: Converting characters
  • Previous by thread: Re: How do you check the equivalency of references?
  • Next by thread: Re: How do you check the equivalency of references?
  • Index(es):
    • Date
    • Thread