Difference between revisions of "Midware TAppSrvClient.Answer"

From Overbyte
Jump to navigation Jump to search
(Created page with ' Main page -> Midware component reference -> TAppSrvClient -> [[Midware_TAppSrvClient.Answer | Answer]…')
 
Line 8: Line 8:
  
 
The Answer property holds the answer from the application server. It is organized as the request: records made of fields. See TMWBuffer description for more details.
 
The Answer property holds the answer from the application server. It is organized as the request: records made of fields. See TMWBuffer description for more details.
 
 
Answer property is to be accessed from the OnRequestDone event handler, when the application server has returned his response.
 
Answer property is to be accessed from the OnRequestDone event handler, when the application server has returned his response.
  

Revision as of 07:41, 3 May 2011

Main page -> Midware component reference -> TAppSrvClient -> Answer

Definition

property Answer: TMWBuffer;

Description

The Answer property holds the answer from the application server. It is organized as the request: records made of fields. See TMWBuffer description for more details. Answer property is to be accessed from the OnRequestDone event handler, when the application server has returned his response.

Example

<syntaxhighlight lang="delphi"> procedure TForm1.AppSrvClient1RequestDone(

 Sender : TObject;
 Error  : Integer);

var

   nRec : Integer;

begin

   if Error <> 0 then begin
       Memo1.Lines.Add('Error #' + IntToStr(Error));
       Exit;
   end;
       
   Memo1.Lines.Add('Answer status = ' + AppSrvClient1.AnswerStatus);
   nRec := 0;
   AppSrvClient1.Answer.First;
   while not AppSrvClient1.Answer.Eof do begin
       Inc(nRec);
       Memo1.Lines.Add(IntToStr(nRec) + ': ' +
                           AppSrvClient1.Answer.RecordToString);
       AppSrvClient1.Answer.Next;
   end;

end; </syntaxhighlight>