Does RichViewEdit had some property to get it's plain text?

General TRichView support forum. Please post your questions here
Post Reply
gcw5zb
Posts: 5
Joined: Thu Sep 08, 2005 8:52 am

Does RichViewEdit had some property to get it's plain text?

Post by gcw5zb »

Does it had?I can get the text ,but is there any simple way like "richedit.text"?
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

s := GetAllText(rv); // function from RVGetText unit
alanmcd
Posts: 53
Joined: Mon Jun 04, 2007 12:25 pm

Post by alanmcd »

If I just do this from a form

Code: Select all

var
  sItemDes: String;
begin
          sItemDes := GetAllText(frmeMEItemList1.DBRichViewEdit1);
          Showmessage(sItemDes);

end;

I see the text excluding format codes which is what I want.

But if I do this via code:

Code: Select all


            LoadRVFFromField(rvHidden, SchoolDB.IB_QItemListExport, 'RVDESCRIPTION');
          sItemDes := GetAllText(rvHidden);
          Showmessage(sItemDes);

where LoadRVFFromField is as you have it above, I get an empty string.
What might be the issue with this?
Alan
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The only reason I can imagine is that LoadRVFFromField fails for some reason, or the field is empty.
alanmcd
Posts: 53
Joined: Mon Jun 04, 2007 12:25 pm

Post by alanmcd »

The field has a value - I can showmessage the value.
The function is:

Code: Select all

function TMEProjectSelect.LoadRVFFromField(rv: TCustomRichView; qry: TIB_Query;
                          const FieldName: String): Boolean;
var Stream: TStream;
begin
  Stream := qry.CreateBlobStream(qry.FieldByName(FieldName), bsmRead);
  try
    Result := rv.LoadRVFFromStream(Stream);
  finally
    Stream.Free;
  end;
end;
alanmcd
Posts: 53
Joined: Mon Jun 04, 2007 12:25 pm

Post by alanmcd »

sorry - should have been LoadRTFFromStream
Alan
Post Reply