I'm looking for a way to check if content of a RichView (assigned to a column of a cxDBGrid and available via TcxCustomGridRecord.Values[<ColumnIndex>] as Variant) is "empty" i.e. the plain text. The call is from an event, where the dataset is not synced with the appropriate record, which is why I cann't the data field.
For similar tasks I'm using these 3 functions already:
function RVFToPlainText_BlobField(RVField: TField): string;
function RVFToPlainText_RichView(RichView: TCustomRichView): string;
function RVFToPlainText_Stream(Stream: TMemoryStream): string;
But none covers the current case.
I thought that using a stream is the closest option and found a suggestion for converting a variant value to a tream, similar to one from here:
http://www.trichview.com/forums/viewtop ... afc#p23310
But I get an EVariantInvalidArgError in
Code: Select all
Size := VarArrayHighBound(lVariant, 1) - VarArrayLowBound(lVariant, 1) + 1;