| | |
help with for loop
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2005
Posts: 4
Reputation:
Solved Threads: 0
this may seem basic but i'm a beginner...i'm writing a program and i need to calculate costs of items which i store into a table and an array.....is there any property or preocedure i could call to enable me to read and add consecutively a set of real numbers in one column in a table....
e.g
item_number//////////////price
1 8.99
2 2.69
3 5.52
i want to beable to add all the prices on a button click to get a total value....
any help no matter how little would be aprreciated...
e.g
item_number//////////////price
1 8.99
2 2.69
3 5.52
i want to beable to add all the prices on a button click to get a total value....
any help no matter how little would be aprreciated...
•
•
Join Date: May 2005
Posts: 41
Reputation:
Solved Threads: 0
the easiest way of adding into array and increasing at same time is as follows
Pascal and Delphi Syntax (Toggle Plain Text)
var myarray :array of integer; lastrecord: integer; begin lastrecord:=0; while lastrecord<20 do begin setlength(myarray,lastrecord+1); myarray[lastrecord]:=input_value; lastrecord:=lastrecord+1; end;
![]() |
Similar Threads
- Help with gui loop. (C)
- Loop...without the loop (Java)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Error Message when updating fields
- Next Thread: Delphi Programmer Seeks Project
| Thread Tools | Search this Thread |





