The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
Indicates whether an input stream has reached End of Stream (EOS).
IsEOS := InStream.EOS
Property Value/Return Value
True if the stream has reached End of Stream; otherwise, false.
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.
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. This example requires that you create the following global variables. You must also create the following file 'c:\MyFolder\MyText.txt'.
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');