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

Iterating through every record in a field and trimming white space

我正在尝试使用以下脚本将字段中的每个值替换为自身的 Trimmed 版本。脚本运行良好,但之后我导出了所有记录,但我仍然看到白色 space - 我是否遗漏了什么?

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

搞清楚了 - 我在循环中遗漏了一个 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

这样的操作不需要循环脚本。 FileMaker 有一个专门用于此目的的功能。

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