Replace 1st or Last Value in a list

I have a list of values, which are all identical.I need to be able to replace the first value in that list (or last value) with a variable.

The list would be something like:

“24”,“24”,“24”,“24”,“24”,“24”,“24”

and then I want to potentially replace the first value in the list with a variable, and potentially the last value in the list.

I have had a look at @replace, @transform and @subsets but can’t seem to work out how to do it.

Any help would be great if someones done something like this before!

Subject: well there are a few ways to do it.

I think array indexes were implemented in Notes 8?

tmp := “24”,“24”,“24”,“24”,“24”,“24”,“24”;

tmp[1] := newstart;

tmp[@Elements(tmp)] := newend;

Background: normally “replace” functions are searching for particular values. If you’re simply replacing one element in an array, that’s the easiest way.

If you have to do this in an earlier version of Notes, it’s tougher to read.

tmp2 := “24”,“24”,“24”,“24”,“24”,“24”,“24”;

tmp := newstart : @Subset(@Subset(tmp2; @Elements(tmp2) - 1); 1 - @Elements(tmp2)) : newend;