Ver Mensaje Individual
  #8  
Antiguo 07-06-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.275
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
Échale un vistazo a éste código:

Código Delphi [-]
 procedure TForm1.BitBtn1Click(Sender: TObject);
 const
   LOG_MAX_MEMO = 200;
 var
   i:Integer;  // nos servirá para ver qué memo utilizamos
   mm:TMemo;
   comp:TComponent;
 begin
 
   // Inicializar la i
   i := 1;
   // Abrir la tabla
   Self.table1.Open;
   // Acceder al primer memo
   mm := TMemo(Self.FindComponent('memo' + IntToStr(i)));
 
   with Self.table1 do begin
     First;
     repeat
       mm.lines.add(FieldByName('Codigo').AsString + ('-------'));
       Next;
 
       // Comprobar si ha llegado a la longitud máxima
       if (Length(mm.Lines.Text) > LOG_MAX_MEMO) then begin
         i := i + 1;
         // Accder al siguiente
         comp := Self.FindComponent('memo' + IntToStr(i));
         // existe?
         if Assigned(comp) then begin
           mm := TMemo(comp);
         end
         else begin
           MessageDlg('Se han acabado los memos...', mtError, [mbOK], 0);
           Self.Table1.Last;
         end;
       end;
 
     until (FieldByName('Codigo').AsString = '') or EOF
   end;
 end;

Éstá generado a partir del tuyo...
__________________
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