Line Property (WScript)
Returns the current line number in an input stream.
object.strStream.Line
The following code demonstrates the use of the Line property.
Dim StdIn, StdOut
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut
Do While Not StdIn.AtEndOfStream
str = StdIn.ReadLine
StdOut.WriteLine "Line " & (StdIn.Line - 1) & ": " & str
Loop
var stdin = WScript.StdIn; var stdout = WScript.StdOut; while (!stdin.AtEndOfStream) { var str = stdin.ReadLine(); stdout.WriteLine("Line " + (stdin.Line - 1) + ": " + str); }
Applies To:
Community Additions
Show: