• 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: Faster List Checking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faster List Checking


  • Subject: Re: Faster List Checking
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 29 May 2003 01:13:05 -0700

On 5/28/03 11:08 PM, "Jeffrey Mattox" <email@hidden> wrote:

> At 10:05 PM -0400 5/28/03, Ken Tozier wrote:
>> Since you're saving your "lists" as strings in the properties
>> "logolist" and "errorlist" you can eliminate looping entirely by
>> just changing AppleSctipt's text item delimiters to the info you are
>> searching for and count the resultant parts. If there's more than
>> one, the data was in the list.
>>
>> For example:
>>
>> set logolist to "joe, jill, jim, pete, bobo, etc..."
>>
>> set AppleScript's text item delimiters to "jim, "
>> yeilds -> "joe, jill, " and "pete, bobo, etc..."
>>
>> if (count text items of logolist > 1)
>> item was in list
>> else
>> item wasn't in list
>> end
>>
>> --reset text item delimiters here
>>
>> No looping necessary!
>>
>> KT
>
> But, it can give incorrect results:
>
> set logolist to "joe, jill, jim, fred, bobo, john, "
> set AppleScript's text item delimiters to "ed, "
> (count text items of logolist) > 1
> --> true
>
> Fred ain't Ed.

set logolist to "joe, jill, jim, fred, bobo, john"
set logolist to " " & logolist & ","
set AppleScript's text item delimiters to " ed,"
(count text items of logolist) > 1
--> false
--
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.

  • Follow-Ups:
    • Re: Faster List Checking
      • From: Gary Lists <email@hidden>
References: 
 >RE: Faster List Checking (From: Jeffrey Mattox <email@hidden>)

  • Prev by Date: RE: Faster List Checking
  • Next by Date: Re: applescript-users digest, Vol 3 #1703 - 4 msgs
  • Previous by thread: RE: Faster List Checking
  • Next by thread: Re: Faster List Checking
  • Index(es):
    • Date
    • Thread