Question

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
Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top