You are here: Symbol Reference > MtxExprInt Namespace > Classes > VectorInt Record > public > Sum Method > VectorInt.Sum Method ()
MtxVec VCL
ContentsIndex
PreviousUpNext
VectorInt.Sum Method ()

Sums vector values.

Pascal
function Sum: integer; overload;

the sum of all calling object elements.

Uses MtxVecInt; procedure Example; var a: TVecInt; b: integer; begin CreateIt(a); a.SetIt([1,2,3,4]); b := a.Sum; // b = 10 FreeIt(a); end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!