I have a procedure related to the TField.OnGetText event of the Score field as follows:
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 the OnGetText documentation , I know that if there is no OnGetText handler, the OnGetText property of the field is the name of the AsString property. But my question is: what value does the var Text get parameter have, OnGetText exists, but the Text value is defined for the current field value. This is in my case, what is the value of Text when the value of the Score field is less than 60? Is it Null , or an empty string, or something else? I need to know this explicitly because there is some kind of logic that depends on the displayed value.
I found out from this post to https://stackoverflow.com/a/212575/129 that nothing is displayed for the field if the OnGetText handler procedure has no code, that is, the body of the procedure is empty.
source share