• 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
indexInListOfItem(aList, aItem)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

indexInListOfItem(aList, aItem)


  • Subject: indexInListOfItem(aList, aItem)
  • From: email@hidden
  • Date: Sun, 29 Jan 2006 19:58:39 EST

my program requires heavily upon the ability to locate the index of an item in a list.
the routine executes properly and then doesnot.
can anyone gander at why?

on listDesc(aList)
    
set zDesc to ("" as Unicode text) & return
    
set zMax to count of aList
    
repeat with zIndex from 1 to zMax
         
set zDesc to zDesc & "(" & zIndex & ") " & itemDesc(item zIndex of aList) & return
    
end repeat
    
return zDesc
end listDesc

on indexInListOfItem(aList, aItem)
    
set zMax to count of aList
    
repeat with zIndex from 1 to zMax
         
if (item zIndex of aList) is aItem then return zIndex
    
end repeat
    
if aList contains aItem then display dialog ("ERROR list " as Unicode text) & return & my listDesc(aList) & return & " does contain item " & my itemDesc(aItem)
    
return 0
end indexInListOfItem

note:  the self-error reporting mechanism works beautifully and demonstrates correct input.
note:  all elemets are of class unicode text which is necessary since hebrew is being processed.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Tell Statement Problem
  • Next by Date: indexInListOfItem(aList, aItem) -- entire code
  • Previous by thread: iPhoto scripting.
  • Next by thread: indexInListOfItem(aList, aItem) -- entire code
  • Index(es):
    • Date
    • Thread