You are here: Symbol Reference > AbstractMtxVecInt Namespace > Classes > TMtxVecInt Class > public > Sum Method > TMtxVecInt.Sum Method ()
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVecInt.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-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!