Ver Mensaje Individual
  #5  
Antiguo 26-06-2007
Deiv Deiv is offline
Miembro
 
Registrado: jul 2005
Ubicación: La Paz - Bolivia
Posts: 364
Reputación: 19
Deiv Va por buen camino
Wink

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?
Responder Con Cita