SoCo Software Logo SoCo Software Title Graphic
Application and MCU Software development
Project publications and public resource page
Goto Home Page
Back To Projects



Source Line Counter

Screen Shot

Just a GUI, but VERY basic, program to total up the amount of text lines in a list of files. Made out of necessity, to count total lines of source code in projects.

Download: SourceLineCounter.zip 189kb (extracts to SourceLineCounter.exe 367kb)

Although there is no source code posted for this project this is the bulk of it:

int i;
AnsiString s;
TStringList* sl;
DWORD Count = 0L;
if (OpenDialog->Execute() == ID_OK)
{
    try
    {
        sl = new TStringList();
        for (i = 0;i < OpenDialog->Files->Count;i++)
        {
            sl->LoadFromFile(OpenDialog->Files->Strings[i]);
            Count += ((DWORD)sl->Count);
        }
        s = Count;
        TotalFilesLabel->Caption = OpenDialog->Files->Count;
        TotalLinesLabel->Caption = s;
    }
    __finally
    {
        delete sl;
    }
}


All applications, source code, documentation, images, and other contents found on this site are the property of 'SoCo' unless otherwise stated.
Site Admin: admin@socosoftware.com