Local variables in repeat
Posted: Tue Aug 19, 2014 2:22 am
I have 8 local variables that I need to put into 8 corresponding fields. I'm wondering how I can do this with repeat. My code doesn't work but is as follows....
the problem here is that the local variables don't appear to be recognized in the repeat. Rather it seems to treat it as a string resulting in "var1", "var2",....ect. So is there a way to identify multiple local variables in a repeat like this?
Thanks
Code: Select all
locals svar1
local svar2 ----and so on until local svar8
put 5 into svar1
put 8 into svar2 --- and so on with different starting points
repeat with i =1 to 8
put "svar" & i into tvar
put "field" & i into tfield
if (sFrame/10) is an integer then
add 1 to tvar
put tvar into field tfield of me
end if
end repeat
Thanks