Tema: TStringList
Ver Mensaje Individual
  #5  
Antiguo 16-01-2004
esquerda21 esquerda21 is offline
Miembro
 
Registrado: may 2003
Posts: 51
Reputación: 21
esquerda21 Va por buen camino
Te he hecho caso y he provado pero me da un error de win.
Supongo q es por no hacer el create SA, no? Lo he comentado mas abajo.
Si es eso , donde lo creo?

type
PMyList = ^AList;
AList = record
SA: TStringList;
end;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
MyList: TList;
ARecord: PMyList;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

begin
MyList := TList.Create;

try
New(ARecord);
ARecord^.SA.Add('1'); // El error empieza aqui
ARecord^.SA.Add('2');
ARecord^.SA.Add('3');
ARecord^.SA.Add('4');
ARecord^.SA.Add('5');
MyList.Add(ARecord);

New(ARecord);
ARecord^.SA.Add('11');
ARecord^.SA.Add('12');
ARecord^.SA.Add('13');
ARecord^.SA.Add('14');
ARecord^.SA.Add('15');
MyList.Add(ARecord);

finally
MyList.Free;
end;


end;

end.
Responder Con Cita