Hiding Delphi null field mask

0

I have a DBText field with phone information, I formatted the field this way "! 99999-9999; 1; _", but when a null field appears, it ends up displaying the hyphen that separate the numbers, is there any How to get away with this character when the field is null?

    
asked by anonymous 23.03.2016 / 19:27

1 answer

0

Use event OnSetText :

procedure TDM.cdsCadClientesFONESetText(Sender: TField; const Text: string);
begin
  if Text = '     -    ' then
    Sender.AsString := ''
  else
    Sender.AsString := Text;
end;
    
27.03.2016 / 19:08