eficsa gracias por tu explicacion me ayudo mucho el tema y un poco de ver codigo basico


ahora tengo otra pregunta cree dentro de esta funcion que retorna un array tipo variant otro array para irle asignando unos valores en los campos
mi pregunta es el array ListArray es igual de tipo variant no se si debo crearlo asi
i:interger
i = 0;
....
ListArray[i] := valor;
i := i +1
para ir incrementado la posicion que solo tiene un valor
ver parte del código
Código Delphi
[-]
function TFMListenerService.GetEventCodeArray(cIOElement : TIOElement): TArrayList;
var
i:integer;
ADOSP : TADOStoredProc;
Conn: Iconnection;
sVehicleId, iCompanyId : string;
Factor, AccelDecel, iCurrSpeed : double;
ListArray : TArrayList; begin
if (cIOElement.ElementEvent.iEventIOId = 0) then begin
if cIOElement.ElementValue(66) >= 6000 then
begin
ListArray[i] := 24;
end
else
Begin
ListArray[i] := 25;
end;
if cIOElement.ElementValue(1) =1 then
begin
ListArray[i] := 31
end;
if cIOElement.ElementValue(10) >= 2000 then
begin
if cIOElement.ElementValue(240) = 0 then ListArray[i] := 3 else
ListArray[i] := 4; end;
try
Conn := ConnPool.GetConnection;
ADOSP.Connection := Conn.Connection; ADOSP.ProcedureName := 'GetOverRpm'; ADOSP.Parameters.Refresh; ADOSP.Parameters.ParamByName('@CompanyId').Value := iCompanyId;
ADOSP.Parameters.ParamByName('@CarNumber').Value := sVehicleId;
ADOSP.Parameters.ParamByName('@Factor').Value := Factor;
ADOSP.Parameters.ParamByName('@EventType').Direction := pdInputOutput;
ADOSP.Parameters.ParamByName('@EventCode').Direction := pdInputOutput;
ADOSP.Open;
factor:= pdInputOutput[0];
finally
ADOSP.Close;
ADOSP.Free;
end;
if cIOElement.ElementValue(11) = 0 then begin
ListArray[i] := 21
end;
Result:= ListArray;