I came across the (inexplicable) resetting of a variable in a loop that is never executed.
Consider the following. The repeat-loop is not executed, but variable c loses its value in the last line, resulting in an error message:
set d to false
set c to "a"
display dialog c -- pretty obvious: displays "a"
if d then
repeat with c in {"x", "y", "z"}
beep
end repeat
end if
display dialog c -- pretty strange error: value "a" is lost !
Why this…?
AS seems to '“reserve” variable c as a running vector in the repeat loop, but why do so before it is ever called…?
Eelco Houwink