Get line number with Line Input function

DOS specific questions.
Cpcdos
Posts: 207
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

Get line number with Line Input function

Postby Cpcdos » Oct 23, 2014 18:54

Hello

All time, i use this :

Code: Select all

open "file.txt" for input as #1
 While Not EOF(1)
   Line Input #1, blabla
   Lines = Lines + 1
   blabla...
   ...
 Wend
Close #1


I have a question, i can get actual line number of #1 ? instead of increment a variable.

Thank
dkl
Site Admin
Posts: 3211
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Get line number with Line Input function

Postby dkl » Oct 23, 2014 20:05

No, I don't think line numbers are counted internally anywhere. Line Input probably always just parses until CR/LF characters (no line counting needed).
Cpcdos
Posts: 207
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

Re: Get line number with Line Input function

Postby Cpcdos » Oct 23, 2014 21:09

Ho yes! okay, i'm stupid!

Thank you! :-)

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 3 guests