Results 1 to 4 of 4

Thread: Number of Lines

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    TX
    Posts
    12

    Number of Lines

    How do you obtain the number of lines that a specified file contains using VB 6?

    Thank you

  2. #2
    Hyperactive Member Dmitri K's Avatar
    Join Date
    Sep 2002
    Location
    West Palm Beach, FL
    Posts
    444
    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

  3. #3
    Hyperactive Member Dmitri K's Avatar
    Join Date
    Sep 2002
    Location
    West Palm Beach, FL
    Posts
    444
    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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    TX
    Posts
    12
    Thanks ALOT !
    That worked Perfectly!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width