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

Recommended Answers

All 6 Replies

basicly you want to add numbers? didnt get quite your post :?:

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.