使用 Lotus Formula 更新列表元素

发布于 2024-07-06 03:52:45 字数 226 浏览 2 评论 0原文

我正在尝试使用 Lotus Formula 更新列表中的元素。

我以为你会这样做:

x := "0":"0":"0";
x[1] := "1";

但是当我尝试保存时出现以下错误:

:= must be immediately preceded by a field or variable name

I am trying to update an element in a list with Lotus Formula.

I thought you would do it like this:

x := "0":"0":"0";
x[1] := "1";

But when I try to save I get the following error:

:= must be immediately preceded by a field or variable name

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的他你的她 2024-07-13 03:52:45

来自 Lotus Domino Designer 7 帮助

不能使用下标运算符
在作业的左侧
陈述。 也就是说,您不能分配
下标元素的值。 你
必须建立完整的列表,然后
分配它。 例如,如果类别
是一个 3 元素列表,你想要
为元素 2 分配新值:

FIELD Categories := Categories[1] : "CatNew" : Categories[3]

通常可以使用 @Implode、@Explode 或 @Replace 来获取。 但如果你确实需要它,你可以这样做:

REM {FieldName[Index] := NewVal};
Index := 2;
NewVal := "CatNew";

maxIndex := @Elements(FieldName);
PrePart := @If(Index > 1; @Subset(FieldName; Index-1); "");
PostPart := @If(Index < maxIndex; @Subset(FieldName; (Index-maxIndex)); "");

Field FieldName := PrePart : NewVal : PostPart

From the Lotus Domino Designer 7 Help:

The subscript operator cannot be used
on the left side of an assignment
statement. That is, you cannot assign
a value to a subscripted element. You
must build the complete list and then
assign it. For example, if Categories
is a 3-element list and you want to
assign a new value to element 2:

FIELD Categories := Categories[1] : "CatNew" : Categories[3]

You can usually get by using @Implode, @Explode, or @Replace. But if you really need it you can do this:

REM {FieldName[Index] := NewVal};
Index := 2;
NewVal := "CatNew";

maxIndex := @Elements(FieldName);
PrePart := @If(Index > 1; @Subset(FieldName; Index-1); "");
PostPart := @If(Index < maxIndex; @Subset(FieldName; (Index-maxIndex)); "");

Field FieldName := PrePart : NewVal : PostPart
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文