Search DaTutorials:  
HOME
VB Script Tutorials
Introduction
Reference
Tutorials

Line Property

Read-only property that returns the current line number in a TextStream file.

object.Line

The object is always the name of a TextStream object.

Remarks

After a file is initially opened and before anything is written, Line is equal to 1.

The following example illustrates use of the Line property:

Function GetLine
   Const ForReading = 1, ForWriting = 2
   Dim fso, f, ra
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.Write "Hello world!" & vbCrLf & "VB Script is fun!" & vbCrLf
   Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)
   ra =   f.ReadAll
   GetLine = f.Line
End Function

See Also

AtEndOfStream Property | AtEndOfLine Property | Column Property

Applies To: TextStream Object


     Credit Card Consolidation | Free Advertising | Hot Music Video | Loans | Watch American Dad
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp