TWSocket.LineLength

From Overbyte
Jump to: navigation, search

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

Definition

property LineLength: integer;

Description

LineLength specifies the length of the last received line in characters if the socket is in LineMode. It will normally be used within the OnDataAvailable eventhandler.

Example

<syntaxhighlight lang="delphi">

 procedure TMySocket.MyOnDataAvailable(Sender: TObject; ErrCode: Word);
 var s  :String; // received packet
     len:Integer; // length of the received packet
 begin
   if ErrCode <> 0 then exit;
   
   s:=;
   s:=ReceiveStr;
   len:=LineLength;
   if (len < 5) then
   begin
     exit;
   end
   else
     MessageBox(s);
 end;

</syntaxhighlight>

Best practices

How to