Échale un vistazo a éste código:
Código Delphi
[-]
procedure TForm1.BitBtn1Click(Sender: TObject);
const
LOG_MAX_MEMO = 200;
var
i:Integer; mm:TMemo;
comp:TComponent;
begin
i := 1;
Self.table1.Open;
mm := TMemo(Self.FindComponent('memo' + IntToStr(i)));
with Self.table1 do begin
First;
repeat
mm.lines.add(FieldByName('Codigo').AsString + ('-------'));
Next;
if (Length(mm.Lines.Text) > LOG_MAX_MEMO) then begin
i := i + 1;
comp := Self.FindComponent('memo' + IntToStr(i));
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...