How can I determine if a Richview document is empty of any characters, excluding control characters. I need to know if there are any visible characters in a document. Checking for no characters may result in counting control characters.
Bennie
Empty RichView
-
- Posts: 130
- Joined: Fri Mar 04, 2011 3:44 am
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 130
- Joined: Fri Mar 04, 2011 3:44 am
When working with DBRichViewEdits the content is saved in blobfields and sometimes it's necessary to check for "empty RichView content" without a RichView but based on the corresponding blobfield.
What would be the best way to do so? Save the blobfield to a stream, create a RichView, load from stream and then check like showed here?
Or is there a better way?
What would be the best way to do so? Save the blobfield to a stream, create a RichView, load from stream and then check like showed here?
Code: Select all
IsEmpty := (rv.ItemCount=0) or ((rv.ItemCount=1) and (rv.GetItemStyle(0)>=0) and (rv.GetItemText(0)=''))
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, if you do not want to parse RVF yourself
(RVF specification - http://www.trichview.com/help/rvf_specification.html
Detecting if RVF contains item-records other than one empty text item is not very difficult, but still requires some efforts)
(RVF specification - http://www.trichview.com/help/rvf_specification.html
Detecting if RVF contains item-records other than one empty text item is not very difficult, but still requires some efforts)