CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    47

    Printing Code - Lines Count

    Is there an easy to find out the total number of Source Lines of Code in a project.

    Thanks


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Printing Code - Lines Count

    you could write an Add-in that iterates over all CodeModule Objects of your project and adds the CountOfLines property of all those modules.
    sample:

    Dim p As VBComponent
    Dim lCount As Long
    For Each p In gVBInstance.VBProjects.StartProject.VBComponents
    lCount = lCount + p.CodeModule.CountOfLines
    Next p
    msgBox "Total: " & lCount


    the disadvantage: blank lines are counted as source lines and in multline statements (_) all lines are counted.

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