0
我正尝试使用Lotus公式更新列表中的元素。使用Lotus公式更新列表元素
我以为你会做这样的:
x := "0":"0":"0";
x[1] := "1";
但是,当我尝试保存我得到以下错误:
:= must be immediately preceded by a field or variable name
我正尝试使用Lotus公式更新列表中的元素。使用Lotus公式更新列表元素
我以为你会做这样的:
x := "0":"0":"0";
x[1] := "1";
但是,当我尝试保存我得到以下错误:
:= must be immediately preceded by a field or variable name
从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]
您可以通过Ÿ通过使用@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
我已经增强了公式,以避免在Index = 1或Index = maxIndex时出现潜在错误 – 2017-07-08 13:41:37