Reputation: 3318
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
Upvotes: 0
Views: 5534
Reputation: 3318
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
Upvotes: 3