Subject DisplayLabel (IB_Components.pas)
Author kljungqvist
Hi

In my applications I sometimes show the results of queries directly
in grids where the grid columns get their captions from the
fieldnames in the query. I also often use underscore ('_') as part
of field names.
However, IB_Components.pas include code which replaces the
underscore with a space character. Thereby giving the illusion of
that the field name contains spaces where it actually contains
underscores.

I would like to change the code in IB_Components.pas on my machine
and comment out this replace part (code below). I understand that
this is perfectly safe in the simple example I gave above but since
I also do more complex things with queries in other parts of my
applications I would like to understand why this replacement is done
in the first place and what I might run into if I make this change.

Or is there another way to get rid of this unwanted behaviour?

Regards,
Kjell Ljungqvist

- -

function TIB_Column.GetDisplayLabel: string;
begin
if FDisplayLabel = '-' then
Result := ''
else
if FDisplayLabel = '/-' then
Result := '-'
else
if FDisplayLabel <> '' then
Result := FDisplayLabel
else
begin
Result := FieldName;
{ // I would like to comment out these lines.
// At least the replace_string part.
if not isLitCriteria( Result, '"' ) then
replace_string( Result, '_', ' ' )
else
Result := stLitCriteria( Result );
}
end;
end;