Yes, but you would need to calculate the entire total as you go. Something like this should do it.
Code:
var
X,MyNumber,MyTotal : Integer;
begin
if ListBox1.Items.Count > 0 then
begin
X := 0;
MyTotal := 0;
repeat
MyNumber := StrToInt(ListBox1.Strings[X]);
MyTotal := MyTotal + MyNumber;
X := X + 1;
until X = ListBox1.Items.Count;
end;
end;
When your feeling down and your resistance is low, light another cigarette and let yourself go
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.