如何使用 feild 中的字符串在 filemaker 中创建变量
我有一个字段,用户可以在其中输入文本,我希望他们能够插入标签,例如
<impact>
或
<signature>
作为我想要插入 html img 的位置的表示。 。因此,如果我能以某种方式将该标签从文本字段提取到一个可以用于替换的变量中。如果我把流程写出来的话,会是这样的。
获取指定字段中每个标签的列表 循环遍历列表,跟踪它在文本中的位置 将标签设置为 var $tag = tagfound 替换标签
Substitute ( texfield; "<$tag>"; '<img src=\"cid:$tag\'>" ;
,此时我还会用 $tag 做其他事情,然后再进行下一次迭代,
有人知道这是否可能/如何实现这一点?
I have a field where the user can input text and I want them to be able to insert tags like
<impact>
or
<signature>
as representation of where I would like to insert an html img. . So if I can somehow extract that tag from the text field into a variable that I can use for the substitution. If I were to write out the processes it would be like this.
get a list of every tag in the specified field
loop through the list keeping track of where it is in the text
set the tag to a var $tag = tagfound
substitute the tag
Substitute ( texfield; "<$tag>"; '<img src=\"cid:$tag\'>" ;
and at this point I would also do other things with the $tag before i went on to the next itteration
anyone know if this is possible /how to make this happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
采取2(感谢您的澄清):
由于您需要循环,因此您需要一个脚本或一个自定义函数。我将向您展示一个脚本,因为每个人都有 scriptmaker(而您需要 FMPA 才能访问自定义函数)。
结果将保存在一个名为 $tag_list 的变量中,之后您可以使用该变量执行您想要的操作。
Take 2 (thanks for the clarification):
Since you need to loop, you need either a script or a custom function. I'll show you with a script since everyone has scriptmaker (whereas you need FMPA to get access to custom functions).
The result will be in a variable called $tag_list which you can do what you want with afterwards.
您可以使用 let 函数在 FileMaker 计算中分配变量:
您还可以像脚本一样使用 let 来进行多项更改,如下所示:
You use the let function to assign variables in a FileMaker calculation:
You can also use let as sort of like a script to make multiple changes like so:
也许这个自定义函数可能会有所帮助。
Maybe this custom function may help.
您不需要“使用标签作为变量”,如果预先知道标签,只需执行替换,例如:
Substitute ( text ; "" ; "newvalue" )
您还可以嵌套多个替换,请检查有关详细信息,请参阅文档。
You don't need to "use the tags as variables", if the tags are known in advance just do a Substitute like:
Substitute ( text ; "<tag>" ; "newvalue" )
You can also nest multiple substitutes, check the docs for details.