Midware TAppSrvClient.Answer

From Overbyte
Revision as of 07:08, 3 May 2011 by Marie (talk | contribs) (Created page with ' Main page -> Midware component reference -> TAppSrvClient -> [[Midware_TAppSrvClient.Answer | Answer]…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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>