Logo

Programming-Idioms

History of Idiom 54 > diff from v7 to v8

Edit summary for version 8 by :

Version 7

2015-08-21, 23:26:30

Version 8

2015-08-22, 21:39:23

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Code
var
  _x: Array of integer;
  _s, i: Integer;
begin
  _s := 0;
  //assume _x contains some values
  for i := Low(_x) to High(_x) do _s := _s + _x[i];
end;