Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleCount the lines of code in Visual Basic 5/6 projects within a directory hierarchy
DescriptionThis example shows how to count the lines of code in Visual Basic 5/6 projects within a directory hierarchy.
Keywordscount lines, project, forms, modules, subs, subroutines, functions
CategoriesSoftware Engineering
 
This program uses drive, directory, and file list controls to let you select a directory. It then uses the FindFirstFile, FindNextFile, and FindClose API functions to examine the Visual Basic .VBP project files in and below that directory in the directory hierarchy. It opens each .VBP file and reads the frm, bas, and cls files the project uses.

The program then opens those files. It finds the start and finish of the frm files' control declarations and it counts the subroutines, functions, properties, comments, and lines in the rest of the file.

This program produced the following results for the directory where I store most of the VB Helper examples:

    Projects:            1733
    Forms:               1499
    Modules:              221
    Classes:               89
    Total Controls:     49909
    Total Lines:       130952
    Total Subs:          5823
    Total Functions:      985
    Total Properties:     463
    Total Comments:     24345

See also Count the lines of code in a Visual Basic 5/6 project.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated