Looping a differenz between Items in a List

Hi to everybody,

As you can see in the pic, I am trying to rest the second Item of a list with the first one, then… the third one with the second one… and so, till last item…

It´s possible to create a loop to this operations without writing 200 lines in a codeblock with all the possiblities?

Because, for example I have to create a 20 lines more if the node “count” has a result of 21…

hi,
first of all, if you are using code block, then use a[0] instead of List.GetItemAtIndex(a,0).

for your case get the list and use List.ShiftIndeices node, and subtract it from the original list

1 Like

wow @khuzaimah.ElecEng … thank you very much…
I have modified it… and it works perfect…