CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Location
    Madrid-Spain
    Posts
    1,123

    Talking CStdioFile, get current line

    Hi!

    I am reading a text file line by line, using CStdioFile and ReadString.

    Is there any way to know what number of line I am reading?

    Thank you in advance.
    I am Miss Maiden... Miss Iron Maiden :-D

  2. #2
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    What about a counter variable? Just increment it each time you call ReadString.

  3. #3
    Join Date
    May 2001
    Location
    Madrid-Spain
    Posts
    1,123
    Yes, I thought that... but I am searching for a function like GetCurLine for CArchive.

    If there isn't other method, I will have to use a counter.

    Thank you for your answer.
    I am Miss Maiden... Miss Iron Maiden :-D

  4. #4
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    No, there is no such thing as GetCurLine() for CStdioFile. Now, depending on your motivation for requiring such a function, an idea might be to derive a class from CStdioFile and implement the counter and GetCurLine() there.

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

Featured