Sunday, September 20, 2015

Livecode repeat structure examples

Loop through controls

repeat with c = 1 to the number of controls of card X
  put the name of control c
end repeat

Loop through array keys

repeat for each key k in tArray
  put "Key: " & k & " - Value: " & tArray[k]
end repeat

Loop through array elements only

repeat for each element e in tArray
  put e
end repeat

Loop until an amount is reached

repeat with tVarNum = 1 to 20
  --do whatever
end repeat

Loop through each line

repeat for each line l in tVar
  put l
end repeat

No comments:

Post a Comment