Ver Mensaje Individual
  #2  
Antiguo 02-12-2008
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 23
maeyanes Va por buen camino
Hola...

Yo te aconsejaría una lista de TStrings:

Código Delphi [-]
// Puede ser un campo de la forma o clase
var
  StringLists: TList;

var
  I: Integer;
  Strings: TStringList;

begin
  // Si no hemos creado la lista lo hacemos:
  if not Assigned(StringLists) then
    StringLists := TList.Create;
  for I := 0 to Pred(Memo1.Lines.Count) do
  begin
    Strings := TStringList.Create;
    // Aquí se hace el desglose de parámetros de la línea actual de Memo1
    StringLists.Add(Strings)
  end
end;

Ya con esto cuando quieras acceder a uno de los StringLists solo tienes que hacer algo como:

Código Delphi [-]
ShowMessage(TStringList(StringLists[0])[0])

Y al destruir la forma o clase que contiene a StringLists haces:

Código Delphi [-]
// Si se creo la lista la destruimos, pero antes liberamos los TStringList
if Assigned(StringLists) then
begin
  for I := 0 to Pred(StringLists.Count) do
    TStringList(StringLists[i]).Free;
  StringLists.Clear;
  StringLists.Free
end;


Saludos...
Responder Con Cita