Édition

Partage via


InStream.EOS() Method

Version: Available or changed with runtime version 1.0.

Indicates whether an input stream has reached End of Stream (EOS).

Syntax

IsEOS :=   InStream.EOS()

Note

This method can be invoked using property access syntax.

Parameters

InStream
 Type: InStream
An instance of the InStream data type.

Return Value

IsEOS
 Type: Boolean
true if the stream has reached End of Stream; otherwise false.

Remarks

If you are reading data from an external component, EOS can return false even though no more data is available. This may occur if you have not called Read first.

Example

The following example opens the text file in a folder that is named MyFolder. The data in the text file is read into and input stream variable named StreamInTest. The InStream.EOS Method is used to determine whether the input stream has reached the end. If the stream has not reached the end, the stream is read into a text buffer, which indicates that the stream has not reached the end until the stream reaches the end. You must also create the following file 'c:\MyFolder\MyText.txt'.

 var
    StreamInTest: InStream;
    FileTest: File;
    Buffer: Text;
begin
    FileTest.Open('c:\MyFolder\MyText.txt');  
    FileTest.CreateInStream(StreamInTest);  
    while not StreamInTest.EOS do begin 
      StreamInTest.ReadText(Buffer);  
      //Do some processing  
      Message('Stream is still processing')  
    end;  
    Message('End of Stream');  
end;

InStream Data Type
Get Started with AL
Developing Extensions