Recent

Author Topic: [solved]Zquery OnGetText method  (Read 2182 times)

doniuzas

  • New Member
  • *
  • Posts: 13
[solved]Zquery OnGetText method
« on: February 11, 2015, 09:28:31 am »
My query field always returning asfloat 1 or 2 (number)
I need change
if asfloat:=2  then asstring:='P'
if asfloat:=1 then asstring:='N'

How i can make this with:

procedure TForm1.zq1outputGetText(Sender: TField; var aText: string;
  DisplayText: Boolean);
begin
 ........
end;


?
« Last Edit: February 11, 2015, 10:45:27 am by doniuzas »

balazsszekely

  • Guest
Re: Zquery OnGetText method
« Reply #1 on: February 11, 2015, 09:55:11 am »
Code: [Select]
procedure TForm1.zq1outputGetText(Sender: TField; var aText: string;
  DisplayText: Boolean);
begin
  DisplayText := True;
  case Trunc((Sender as TField).AsFloat) of
    1: aText := 'N';
    2: aText := 'P';
    else
       DisplayText := False;
  end;
end;

doniuzas

  • New Member
  • *
  • Posts: 13
Re: Zquery OnGetText method
« Reply #2 on: February 11, 2015, 10:45:09 am »
thanks getmem

 

TinyPortal © 2005-2018