Adding in Sequence

Hello all,

Is there a way to Add a list of numbers in the Sequence they are in the list?

List (1,2,3,4,5,6)

How I want to add

1
1+2
1+2+3
1+2+3+4
Ex…

Thanks

try one of these.

1 Like

Matt,

Thank you very much. Both of your solutions work perfectly.

You could add these to the collection too …

1 Like

Another one:

1 Like

And a for loop? :slight_smile:

a=[Imperative]
{
b=1..5;
c=0;
d={};
e=0;
for (i in b)
	{
	d[e]=i+c;
	c=d[e];
	e=e+1;
	}
return = d;
};
1 Like