the following piece of AppleScript gives a false result. nameList is a list containing names. I have a second list called indexList which contains a list of indices to the nameList set of particular names requiring further investigation.
set cntr to the count of nameList
repeat with index in indexList
repeat with ind from 1 to cntr
if index is equal to ind then
-- process the corresponding entry in nameList
end if
end repeat
end repeat
This piece of code does not work. So I added a line to give me the class of both "index" and "ind". Both were described as "integer". However, when I added a further libe of "set index to index as integer" between the two repeat lines, the code starts to work correctly. Each time I got a match between "index" and "ind", I was now able to process the entry.
Why does this work when both variables had previously shown as class integer?