Ver Mensaje Individual
  #3  
Antiguo 24-10-2006
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 26
seoane Va por buen camino
Aquí tienes otra forma de hacerlo:

Código Delphi [-]
// Para guardar
var
  i: integer;
begin
  with TStringList.Create do
  try
    for i:= 0 to StringGrid1.RowCount - 1 do
      Add(StringGrid1.Rows[i].CommaText);
    SaveToFile('d:\1.txt');
  finally
    Free;
  end;
end;


//Para recuperar
var
  i: integer;
begin
  with TStringList.Create do
  try
    LoadFromFile('d:\1.txt');
    StringGrid1.RowCount:= Count;
    for i:= 0 to Count - 1 do
      StringGrid1.Rows[i].CommaText:= Strings[i];
  finally
    Free;
  end;
end;
Responder Con Cita