I am not sure how you can define a by default empty list in @formula language. Is there a way to achieve that?
so far I came up with:
list:= “a”;
list:=@Subset(list;@Member(“”;list)-@Elements(list));
I am not sure how you can define a by default empty list in @formula language. Is there a way to achieve that?
so far I came up with:
list:= “a”;
list:=@Subset(list;@Member(“”;list)-@Elements(list));
Subject: What are you trying to achieve?
maybe something like list := @trim(“”)
Subject: RE: What are you trying to achieve?
I am trying to build up a list and conditionally add items to it. Not in one call but in multiple calls.
The items does not come from a notes view or anything.
Subject: list:=@Explode(“”;“”)
list:=@Explode(“”;“”)
Subject: Why?
An uninitialized variable is treated as “” - an empty string, except if you call @Elements(myUnitializedVariable), in which case it should return 0. Is there a context where you think an empty list would behave differently from that?
-rich
Subject: RE: Why?
not sure if it would behave differently but I want conditionally add items to a list.
e.g. in JS I could define A = ; A.push(“Kiwi”);
Subject: RE: Why?
This will work for the equivalent of your JS operation:
list := “Kiwi” : @Trim(list);
It has the side effect of trimming spaces from elements of the list, but other than that it does what you want because it does remove elements that are empty strings from the list. So all you ever need to do to clear it and start over again is to say list := “”;