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 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....


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...

basically thats it....i want to add all the numbers from the price column.....want the sum of all the numbers..

you have a known array of numbers/items?

in pseudo code:

on click event

sum := 0
for i := 1 to length_of_array do
sum := sum + array;

well the array is not of a known depends on how many numbers the person has entered....thanks for the pseudo code.....thats part of it but how do i get each number the person has entered to be stored into the array.

the easiest way of adding into array and increasing at same time is as follows

 myarray :array of integer;
 lastrecord: integer;


while lastrecord<20 do

thanks 4 da help...can't try it out now...had to format my pc...thanks 4 da hepl as soon as i try it out i'll let u know if it works the way i wanted...thanks.

This article has been dead for over six months. Start a new discussion instead.