Delphi array data

Hello guys I need help for transcript a routine in PHP for Delphi.

In PHP I have this routine

$i 			= 0;
$geral 	= 0;
while($resposta = mysql_fetch_array($sql)){

		$Qtd[]			        =	$resposta['QTD_ATUAL'];
		$ID_PRODUTO[]	=	$resposta['Id'];
		$CODIGO[]		        =	$resposta['CODIGO'];
		$LOTE[]			        =	$resposta['LOTE'];
		$VALIDADE[]		=	$resposta['VALIDADE'];
		$geral		                =	array_sum($Qtd);


Open in new window

How do that  in Delphi?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sinisa VukSoftware architectCommented:
It is hard to understand what you do? mysql_fetch_array will get records/arrays from database.
Do you have any database in Delphi already? this while will iterate through dataset (Delphi) and do some calculation (sum)...
geral := 0;
while not Data.Eof do
  geral := geral + Data.FieldByName('QTD_ATUAL').AsFloat;

Open in new window

... where Data is Delphi dataset .
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.