Click here to Skip to main content
Click here to Skip to main content

Counting Lines in a MS VC++ 6.0 project

By , 4 Aug 2001
 

Sample Image - LineCounter.gif

Introduction

Ever wondered how many lines a project you have worked on for a month (or maybe for a year!)? Well, we did this for you :)

This program (LineCounter) was developed with one purpose only: to count your lines!

The program is able to count source code, comments (both styles: "// comment" and "/* comment */"), and blank lines. It shows the results in a couple of editboxes, and has a preview window (right click on the list).

The program opens the project file (.dsp) and throws it through the parsing code. After parsing is done the list of project files is steped-by-step and lines are counted.

That's it! The source code is pretty self explanatory, so I guess you'll manage.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

_declspec
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralHmm, .dswmemberRazvan Marcus12 Dec '01 - 3:19 
What about starting from a WorkSpace: .dsw file.
 
Best regards,
GeneralGood workmemberRejeesh.T.S8 Aug '01 - 23:09 
Good work. I have a suggestion. U should have put a number for each line at the time of viewing the file.
QuestionAnd those constructions?memberAnonymous6 Aug '01 - 11:19 
What about those constructions:
 
int n; //counter
 
or
 
/*
This is a very useful
help about the function
*/
GeneralTeacher caught me using Java...memberStephen Kellett6 Aug '01 - 11:01 
I must not use Java, .Net is the way...
I must not use Java, .Net is the way...
I must not use Java, .Net is the way...
I must not use Java, .Net is the way...
I must not use Java, .Net is the way...
I must not use Java, .Net is the way...
 
Damn these blackboards....
 
Stephen Kellett
--
C++/Java/Win NT/Unix variants
Memory leaks/corruptions/performance/system problems. UK based.
Problems with RSI/WRULD? Contact me for advice.

GeneralRe: Teacher caught me using Java...memberck6 Aug '01 - 11:20 
so what's your point?
GeneralRe: Teacher caught me using Java...memberPaul Evans25 Mar '03 - 5:41 
Java is the way to platform independence, .Net is what MS wanted to do with Java - extend, "improve" - thus making it incompatiable with anything else.
 
Java is the way to go. I program in .Net at work and it's alright - but if you have a choice go Java. Java is more mature and the J2EE is proven.
 
Once you go .Net you are hopelessly locked into the MS way. For instance do you know that Windows 2000 support is going to end in 2005? Forced upgrades, closed source core products... think about it...
 
/**********************************
Paul Evans, Dorset, UK.
Personal Homepage "EnjoySoftware" @
http://www.enjoysoftware.co.uk/
**********************************/

QuestionIt's a dupe?memberGeorge5 Aug '01 - 16:46 
Hm... There is a nice line counting free utility:
http://www.wndtabs.com/plc/
AnswerRe: It's a dupe?member_declspec5 Aug '01 - 21:25 
I had no idea about that program (wndtabs.com/plc/).
This program was written in a saturday night when my fried and me were trying to relax.
 

_declspec
GeneralRe: It's a dupe?memberBrian V Shifrin6 Aug '01 - 12:06 

Also wndtabs looks better, it uses worspaceWiz (shareware ?). I vote
for this project because it is self-contained.
 
Brian
GeneralRe: It's a dupe?memberGeorge7 Aug '01 - 1:15 
No, it's WWhizInterface and it's free, it comes as a part of WorkspaceWhiz (WorkspaceWhiz is shareware, but you don't need it all, WWhizInterface is enought)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 5 Aug 2001
Article Copyright 2001 by _declspec
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid