TWSocket.ReceiveStr

From Overbyte
Revision as of 21:35, 21 November 2007 by Frla (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Main page -> ICS component reference -> TWSocket -> ReceiveStr

Definition

function ReceiveStr: string;

Description

ReceiveStr is used (mainly in OnDataAvailable if the component is set to use LineMode. It receives the next complete line which has been sent to the attached IP/port. ReceiveStr returns the whole line sent, including the delimiter characters set via LineEnd.

Example

 procedure TMySocket.MyOnDataAvailable(Sender: TObject; ErrCode: Word);
 var s    :String; // received packet
 begin
   if ErrCode <> 0 then
   begin
     exit;
   end;
 
   s:=ReceiveStr;
 end;

Best practices

How to