How do you obtain the number of lines that a specified file contains using VB 6?
Thank you
Printable View
How do you obtain the number of lines that a specified file contains using VB 6?
Thank you
dim x as long
dim tmpvar as string
x = 0
open specified_file for input as #1
do until eof(1)
line input #1, tmpvar
x = x+1
loop
close #1
msgbox "file contains " & x & " lines."
work out the rest :)
i think there might also be an API for that, but I'm not quite sure. Maybe I just confused some other line related task with line count, but this pure vb way works just fine.
Thanks ALOT !
That worked Perfectly!