View Single Post
  #1   Spotlight this post!  
Unread 17-04-2006, 12:05
lesmayers lesmayers is offline
Registered User
no team
 
Join Date: Apr 2006
Location: kent
Posts: 2
lesmayers is an unknown quantity at this point
Calculative help !!

Hi

My friend has a problem with this delphi code..
She wants a set of integer numbers that people enter into boxes and results give total..Can anyone help.
This is what she has sent:

procedure TfrmAddFor.btnAddClick(Sender: TObject);
var
Number : string;
Count, Sum : integer;
begin
Count := 1;
Sum := 0;
for Count := 1 to 20 do;
Number := InputBox('Enter number', 'Number', ''); //create InputBox
Count := Count + 1;
Sum := Sum + StrToInt(Number);
lblIterationNumber.Caption := 'Iteration Number:' + Number;
lblSum.Caption := 'Cumulative Sum:' + IntToStr(Sum);
end;
end.

Tx for any help