使用Lotus Formula更新列表元素



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

我以为你会这样做:

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

但是当我尝试保存时,我得到以下错误:

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

从Lotus Domino Designer 7帮助:

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

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

通常可以使用@Impode、@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

最新更新