Visual Basic Scripting Edition | 語言參考 |
TextStream 文件中,如果文件指針指向行末標(biāo)記,就返回 True;否則如果不是只讀則返回 False。
object.AtEndOfLine
object 應(yīng)為 TextStream 對(duì)象的名稱。
AtEndOfLine 屬性僅應(yīng)用于以讀方式打開的 TextStream 文件,否則會(huì)出現(xiàn)錯(cuò)誤。
下列代碼舉例說明如何使用 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 = retstring
End Function
AtEndOfStream 屬性 | Column 屬性 | Line 屬性
應(yīng)用于:TextStream 對(duì)象