Livecode 重复命令

Livecode repeat command

我有下面的代码,我想完成以下内容。
我有一个包含一些字段的组。
我有 2 个变量。变量 1 的名称来自字段,变量 2 的值。
我想将组中字段的文本设置为变量 2。
Var 1 的第 1 行 = 字段名称 1 -- Var 2 第 1 行 = 值
Var 1 的第 2 行 = 字段名称 2 -- Var 2 第 2 行 = 值

repeat with x=1 to the number of flds of grp "flds_grp"
          add 1 to counter
          put the short name of  fld x & cr after fldNames
     end repeat

     set the itemdel to comma
     put 0 into myCounter
     repeat for each line f in fldNames
          repeat for each line t in tvalues



          end repeat
     end repeat

你有一个变量counter但你似乎不需要这个变量。

要将字段 f 的文本设置为变量 t 的值,请使用以下语法:

set the text of field f to t

Livecode 论坛中的 Sparkout 已经回答了正确的方法。

repeat with x=1 to the number of flds of group "grp-A"
   put line x of tValues into field x of group "grp-A"
end repeat