How to determine if there is text in a TBlobField
Posted: Thu Dec 22, 2005 8:01 pm
Hi All
I have a calculated Boolean field that it indicates to me if there is (or not) text in a field. The objective of this field is to show (in a TDBGrid) if there is text or no.
Then, if I calculate the result based on the IsNull property I do not obtain the correct result, since the field is edited by a form that contains a TDBRichViewEdit.
I need to show whether are a text in the record. Since the records are edited by a Form with a TDBRichViewEdit and other controls, although I do not even put information in the TDBRichViewEdit control, it's stores some information in the BlobField ¿right?
The property BlobSize is 0 (when IsnUll is True), but after the first "edition" no longer it returns to be 0, but an arbitrary value... depending -among other things- of the value of the RVFOptions property.
I would need something like...
CalculatedThereIsText.AsBoolean := (GetAllText(BlobField)<>'')
but, the GetAllText() function is:
function GetAllText(rv: TCustomRichView): String;
var i: Integer;
begin
if rv.ItemCount=0 then begin
Result := '';
exit;
end;
i := 0;
Result := GetItemText(rv, i);
for i := i+1 to rv.ItemCount-1 do begin
if rv.IsFromNewLine(i) then
Result := Result + #13#10;
Result := Result+GetItemText(rv, i);
end;
end;
There is some way to do this without constructing the TDBRichViewEdit control?
Thanks for readme and sorry for my english.
Tavo.
I have a calculated Boolean field that it indicates to me if there is (or not) text in a field. The objective of this field is to show (in a TDBGrid) if there is text or no.
Then, if I calculate the result based on the IsNull property I do not obtain the correct result, since the field is edited by a form that contains a TDBRichViewEdit.
I need to show whether are a text in the record. Since the records are edited by a Form with a TDBRichViewEdit and other controls, although I do not even put information in the TDBRichViewEdit control, it's stores some information in the BlobField ¿right?
The property BlobSize is 0 (when IsnUll is True), but after the first "edition" no longer it returns to be 0, but an arbitrary value... depending -among other things- of the value of the RVFOptions property.
I would need something like...
CalculatedThereIsText.AsBoolean := (GetAllText(BlobField)<>'')
but, the GetAllText() function is:
function GetAllText(rv: TCustomRichView): String;
var i: Integer;
begin
if rv.ItemCount=0 then begin
Result := '';
exit;
end;
i := 0;
Result := GetItemText(rv, i);
for i := i+1 to rv.ItemCount-1 do begin
if rv.IsFromNewLine(i) then
Result := Result + #13#10;
Result := Result+GetItemText(rv, i);
end;
end;
There is some way to do this without constructing the TDBRichViewEdit control?
Thanks for readme and sorry for my english.
Tavo.