Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP Line Property

ASP Line Property


TextStream Object Reference Complete TextStream Object Reference Manual


The Line property returns the current line number in a TextStream file (starting from 1).

Syntax

TextStreamObject.Line

Example

<%

dim fs,f,t

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

set f=fs.CreateTextFile("c:\test.txt",true)

f.WriteLine("Hello World!")

f.WriteLine("How are you today?")

f.WriteLine("Goodbye!")

f.close

Set t=fs.OpenTextFile("c:\test.txt",1)

do while t.AtEndOfStream=false

  Response.Write("Line " & t.Line & ": ")

  Response.Write(t.ReadLine)

  Response.Write("
")

loop

t.Close

%>

Output:

Line 1: Hello World!

Line 2: How are you today?

Line 3: Goodbye!


TextStream Object Reference Complete TextStream Object Reference Manual