Ver Mensaje Individual
  #4  
Antiguo 14-01-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.297
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por esocrates
Lo que quiero hacer es guardar el contenido de los memos en una carpeta del disco.
Intento, sin conseguirlo, hacer un bucle que recorra todos los TabSheets y guarde el contenido de los memos. Esa es la idea que quiero llevar adelante.
Prueba con algo como ésto:

Código Delphi [-]
 procedure TForm1.Button2Click(Sender: TObject);
 const
   DIRECTORIO = 'c:\Temp\';
 var
   i,j:Integer;
 begin
 
   j := 0;
 
   // Recorrer las páginas
   for i := 0 to (PageControl1.PageCount - 1) do begin
     // Buscar el memo que hay en ese página
     while j < (Self.ComponentCount) do begin
       // Es un memo ?
       if (Self.Components[j] is TMemo) then begin
         // Es el que hay en ese TabSheet?
         if (TMemo(Self.Components[j]).Parent = PageControl1.Pages[i]) then begin
 
           // Grabar
           TMemo(Self.Components[j]).Lines.SaveToFile(
             DIRECTORIO + TMemo(Self.Components[j]).Name +
             '.txt');
 
         end;
       end;
 
       j := j + 1;
 
     end;
     j := 0;
   end;
 end;

Si tienes dudas ya dirás...
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita