I have a procedure attached to TField.OnGetText
event of field Score
like this:
procedure TMyForm.GetScoreText(Sender: TField; var Text: string; DisplayText: Boolean);
begin
if StrToInt(Sender.AsString) >= 80 and StrToInt(Sender.AsString) <= 100 then
Text := 'Great!';
else if StrToInt(Sender.AsString) >= 60 and StrToInt(Sender.AsString) < 80 then
Text := 'Good';
end;
From OnGetText
documentation, I know that when there is no OnGetText
handler defined, the Text
property of the field is the name as AsString
property. But my question is, what value does the var
parameter Text
get there is an OnGetText
defined but the the Text
is defined for the current value of the field. That is in my case, what value does the Text
get when value of the field Score
is something less than 60? Is it Null
, or empty string, or something else? I need to know it explicitly because there is some logic that depends on the value being displayed.
I learned from this SO post that there was nothing being displayed for the field when the OnGetText
handler procedure has no code, that is body of the procedure is empty.