2005. július 19., kedd

How to read a TMemoField into a TMemo


I would like to read the lines from a memo field into my program using FieldByName().As. There does not seem to be any way to move the memo into a TString or TStringList or to access the memo field on a line by line basis. You can use a String or Variant. When you do this you get just one long composite string. Can you help?


Almost every TStrings descendant has a LoadFromStream method:

procedure TForm1.DataSource1DataChange(Sender: TObject; Field: TField);
  TB: TBlobStream;
  with TDataSource(Sender).DataSet do
    if (State = dsBrowse) then
      TB := TBlobStream.create(FieldByName('Event_Description') as TBlobField, bmRead);
      {or ListBox1.items.LoadFromStream(TB);}
      {or StringList1.LoadFromStream(TB);}

Nincsenek megjegyzések:

Megjegyzés küldése