El código:
Código Delphi
[-]
type
MiArray = array[0..3] of string;
var
i,j,x: integer;
A:MiArray;
B: TStringList;
begin
B:= TStringList.Create;
x:=0;
........
with ADOQuery1 do
begin
first;
while not eof do
begin
if (B.IndexOf(FieldByName('Tipo').AsString)=-1) then
begin
A[x]:= FieldByName('Tipo').Value;
inc(x);
end;
next;
end;
end;
...
end;
Me lanza error en la línea:
if (B.IndexOf(FieldByName('Tipo').AsString)=-1) then
Project raised exception class EAccess Violation
Imagino que es porque no está lleno el TStringList, es decir imagino que no use el método ADD, ¿alguna orientación, de cómo corregirlo?