..


Sponsored Links

AtEndOfStream

The properties of AtEndOfStream 'TextStream returns True if the pointer is positioned at the end of the file, otherwise it returns False.

Note: This property will only work with a TextStream opened for reading.

Let's take an example.
Suppose you have a text file (c: \ test.txt) with the following contents:

 



 Hello what's your name?







 My name is Marcello!

 
This is the code





 dim fs, t, x









 'I open one instance of the FSO







 Set fs = Server.CreateObject ("Scripting.FileSystemObject")

 







 'I open in read mode







 set T = fs.OpenTextFile ("c: \ test.txt", 1, false)









 'I create a loop that is stopped at the end of the file







 do while t.AtEndOfStream <> true



  



 x = t.Read (1)







 loop









 'I close everything







 t.Close







 Set T = Nothing







 Set fs = Nothing









 'Mold Video







 The output is:

 
 



 The last character is:!

 

In the same category ...
E-Learning
ASP (Advanced) ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €.
ASP Zero (Ebook) ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €.
ASP and Access (Ebook) ASP and Access (Ebook)
Managing a MS Access database with ASP. At only 29 €.
Sponsored Links