AtEndOfLine Property (FileSystemObject)
Updated: September 2010
Returns true if the file pointer is positioned immediately before the end-of-line marker in a TextStream file; false if it is not. Read-only.
object.AtEndOfLine
The object is always the name of a TextStream object.
The AtEndOfLine property applies only to TextStream files that are open for reading; otherwise, an error occurs.
The following code illustrates the use of the AtEndOfLine property:
function GetALine(filespec) { var ForReading = 1; var fso = new ActiveXObject("Scripting.FileSystemObject"); var file = fso.OpenTextFile(filespec, ForReading, false); var s = ""; while (!file.AtEndOfLine) { s += file.Read(1); } file.Close(); return (s); }
Function GetALine(filespec)
Dim fso, file, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(filespec, ForReading, False)
s = ""
Do While file.AtEndOfLine <> True
s = s & file.Read(1)
Loop
file.Close
GetALine = s
End Function
Applies To:
Community Additions
Show: