遍历字段中的每条记录并修剪空白

时间:2018-06-28 19:00:35

标签: filemaker

我正在尝试使用以下脚本将字段中的每个值替换为其自身的Trim med版本。该脚本运行正常,但是之后导出所有记录,仍然看到空白-我丢失了什么吗?

Go to Record/Request/Page [First]
Loop
    Exit Loop If [Let($c=$c+1;$c>Get(FoundCount))]
    Set Field [MyDataBase::MyField; Trim ( MyDataBase::MyField )]
    Commit Records/Requests [With dialog:On]
End Loop

2 个答案:

答案 0 :(得分:1)

此类操作无需循环脚本。 FileMaker具有用于此确切目的的功能。

Replace Field Contents [MyDataBase::MyField; Trim ( MyDataBase::MyField )]

答案 1 :(得分:0)

弄清楚了-我在循环中缺少Go to Record/Request/Page [ Next ]。最终的工作代码是:

Go to Record/Request/Page [First]
Loop
    Exit Loop If [Let($c=$c+1;$c>Get(FoundCount))]
    Set Field [MyDataBase::MyField; Trim ( MyDataBase::MyField )]
    Commit Records/Requests [With dialog:On]
    Go to Record/Request/Page [ Next ]
End Loop