indexInListOfItem(aList, aItem)
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