TextStream 文件中,如果文件指針指向行末標記,就返回 True;否則如果不是只讀則返回 False。
object.AtEndOfLine
object 應為 TextStream 對象的名稱。
AtEndOfLine 屬性僅應用于以讀方式打開的 TextStream 文件,否則會出現錯誤。
下列代碼舉例說明如何使用 AtEndOfLine 屬性:
Function ReadEntireFile(filespec) Const ForReading = 1 Dim fso, theFile, retstring Set fso = CreateObject("Scripting.FileSystemObject") Set theFile = fso.OpenTextFile(filespec, ForReading, False) Do While theFile.AtEndOfLine <> True retstring = theFile.Read(1) Loop theFile.Close ReadEntireFile = retstringEnd Function
新聞熱點
疑難解答
圖片精選