Einzelnen Beitrag anzeigen

-lx-
(Gast)

n/a Beiträge
 
#10

Re: Unbekannte Anzahl an Zeilen auslesen + unerwartete Textz

  Alt 24. Jul 2006, 10:42
Zitat:
function ReadLn(ATerminator: string; const ATimeout: Integer; AMaxLineLength: Integer): string; virtual;

Parameters

ATerminator: string = LF

End-of-line termination character or characters.

const ATimeout: Integer = IdTimeoutDefault

Time-out in milliseconds. Default value IdTimeoutInfinite.

AMaxLineLength: Integer = -1

Returns

String - Line read from the buffer.

Description

ReadLn is a function that returns a string containing a single line from the buffer maintained by TIdTCPConnection.

The optional ATerminator parameter indicates the end-of-line symbol for the particular protocol. If data is expected, and you do not need a custom end-of-line symbol, you can use the default ATerminator value (#0). ATerminator values include:

#0 - Default Line Feed (#10)
LF - Line Feed (#10)
CR - Carriage Return (#13)
EOL - End-of-line (Carriage Return + Line Feed)


If there is no terminator (ATerminator) in the buffer, ReadLn will read more bytes from the TCP stack through the ReadFromStack method.

Use a custom time-out (ATimeout) value to change the number of milliseconds to wait for a response from the peer connection before a time-out occurs. The default value for ATimeout is IdTimeoutInfinite. See IdGlobal.pas for more information on constant timeout values.

ReadLn will return an empty string ('') if the peer connection is prematurely closed or a time-out occurs. When a timeout condition occurs in ReadLn, the ReadLnTimedOut property is set to True.
Wenn ihr mir nun nochmal helfen könntet das zu entschlüsseln wäre dies sehr hilfreich.

Also dieses TimeOut Ding würde in Verbindung mit einem Timer gut funktionieren, da man ja eig. aus schleifen nicht einfach aussteigen sollte außer ich nehm ne repeat-until bzw. do-while schleife.
Wie geht das aber nun mit diesem EOL ? scheint eine etwas elegantere Methode zu sein.
Jedoch werd eich aus der Hilfe dazu (s.o.) nicht schlau. Es liegt vll. daran, dass ich Delphi direkt gelernt habe. D.h. es wurde kein Wert darauf gelegt, wie der Syntax zu stand ekommt und wieso usw... das mal am Rande.



Mit freundlichen Grüßen
  Mit Zitat antworten Zitat