PDA

View Full Version : Useful little program (maybe)



AthenaOfDelphi
16-03-2007, 12:55 AM
Ever wondered how many lines of Pascal reside in all the .pas files on your machine? No??? I'm shocked... I lie awake at night pondering that very thought ;-)

Just kidding of course, but I was wondering how many lines of code are in a new system I'm writing as its the first big PHP project I've worked on. I tried to find a program to count the number of lines on-line, but couldn't find one that didn't cost money.

So I wrote a simple one... its real high tech ;-) And wouldn't you know, while waiting for it to scan one of my drives, I found a free one on-line... typical :-)

Anyhow, if anyone has need of a simple line counting program, you are more than welcome to use it. Its available on my blog here (http://athena.outer-reaches.com/wp/index.php/archives/109).

cairnswm
16-03-2007, 04:47 AM
My game dev directory counts 320937 lines of Pascal code :shock:

Talk about being verbose!

Huehnerschaender
16-03-2007, 07:44 AM
Using BDS I have a hidden directory "History" in every projects directory where all changed files are backed up when saving the project. And not only once but change by change a new file is created, so you can get back older versions of your code easily.

My question now:

Do you factor this in your line counter? I mean, thats a lot of lines which are just "backups" of my real code...

Greetings,
Dirk

AthenaOfDelphi
16-03-2007, 09:30 AM
In short Dirk, no I don't :-)

It was a quick dirty little program to get the job done... if enough peeps ask for extra functionality, maybe I'll extend it :-) Maybe add a --bds switch that takes the versioning system into account ;-)

I scanned my main work drive last night... 7890 .pas files containing a whopping 6.3Mil lines :-o That number was so big I had to double check the code to make sure it was working properly :-)

JernejL
16-03-2007, 11:38 AM
doesn't work, i run it in directory i want it to scan, and it just does nothing, i tried specifying directory and all and it just doesn't work.

i tried:


lcount.exe "C:\Documents and Settings\...\Delfi\*.pas" -subdir


lcount.exe *.pas -subdir

AthenaOfDelphi
16-03-2007, 01:43 PM
Hi Delfi,

Thanks for the feedback :-)

I didn't take into account long filenames enclosed in quote.... I can sense version 1.1 coming later today ;-)

The switches like subdir, are linux style... you need two - characters before the switch, so your second example:-



lcount *.pas --subdir

Robert Kosek
16-03-2007, 01:54 PM
Neat little utility, Athena.

My current (trimmed down) delphi projects directory (always has been "C:\Delphi") is 39k lines. My old one has 113k lines. Not bad for an amateur. :D

jdarling
16-03-2007, 02:01 PM
Well, I have 67,846 lines of code in the JumpStart core engine (That was a surprise), 481 lines of code in the lpr files, and 5,580 lines of script code for Secrets of the Domus Aurea.

I must say, I was surprised to find out how much code is sitting behind my entry this year :)

3_of_8
16-03-2007, 02:10 PM
Some time ago I wrote a thing called "LOC-o-meter" to count my code lines. It's kinda primitive, I use it with the SendTo-Function of windows, marking all my code files and then send-to-ing them to LOC-o-meter.

MechaChess currently consists of 7322 lines and 193572 bytes of code which is not as much as I hoped. My project is a little... suspended due to a lack of motivation, time, a XML-parser and models. Anyway, I should keep to the point.

vgo
16-03-2007, 03:54 PM
Looks like I already got 41057 lines of code in my entry. :o

AthenaOfDelphi
16-03-2007, 09:29 PM
I have to say I'm shocked that even this many people took an interest :-)

But to address some of the concerns/comments I've just posted Version 1.1 :-)

Enjoy :-D