procedure TForm1.Button1Click(Sender: TObject);
var
reqbuf,rcvbuf
Char;
ret :integer;
lenf:LongInt;
temp:array [0..50] of char;
Size:Byte;
begin
ret:= tpinit(nil);
if ret<0 then
begin
//showmessage('tpinit failed');
Edit2.text:= 'tpinit failed';
exit;
end;
reqbuf := tpalloc('STRING', '', 1024);
if reqbuf=nil then
begin
Edit2.text:='tpalloc failed';
exit;
end;
rcvbuf := tpalloc('FML','',32000);
if rcvbuf=nil then
begin
Edit2.text:='tpalloc rcvbuf failed';
exit;
end;
Size := Edit1.GetTextLen;
Inc(Size);
Edit1.GetTextBuf(reqbuf,Size);
lenf:=0;
ret := tpcall('InqueryCustomer', reqbuf, 0, rcvbuf, lenf, 0);
if (ret<0) then
begin
Edit2.text:='tpcall failed';
exit;
end ;
StringGrid1.Cells[0,1]:='1';
lenf:=0;
temp:='';
Fget(rcvbuf,41062,0,temp,lenf);
//FCUSTOMERID
StringGrid1.Cells[1,1]:=temp;
lenf:=0;
temp:='';
Fget(rcvbuf,41061,0,temp,lenf);
//FUSERNAME
StringGrid1.Cells[2,1]:=temp;
lenf:=0;
temp:='';
Fget(rcvbuf,41063,0,temp,lenf);
//FADDRESS
StringGrid1.Cells[3,1]:=temp;
lenf:=0;
temp:='';
Fget(rcvbuf,41064,0,temp,lenf);
//FSTATUS
StringGrid1.Cells[4,1]:=temp;
lenf:=0;
temp:='';
Fget(rcvbuf,41065,0,temp,lenf);
//FSTARTDATE
StringGrid1.Cells[5,1]:=temp;
lenf:=0;
temp:='';
Fget(rcvbuf,41066,0,temp,lenf);
//FPREPAYMENT
StringGrid1.Cells[6,1]:=temp;
lenf:=0;
temp:='';
Fget(rcvbuf,41067,0,temp,lenf);
//FREMARK
StringGrid1.Cells[7,1]:=temp;
lenf:=0;
temp:='0';
Fget(rcvbuf,41074,0,temp,lenf);
//FERRONO
Edit2.text:=abouterro(temp);
tpfree(reqbuf);
tpfree(rcvbuf) ;
tpterm;