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?
Sinisa VukCommented:
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 .
All Courses

From novice to tech pro — start learning today.