Sum of the total lines written in .prg and .fmg

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Sum of the total lines written in .prg and .fmg

Post by Claudio Ricardo »

Hi All..
Alguien conoce algún programa que sume cuantas lineas hay escritas en cada archivo .prg, .fmg
Es muy tedioso abrir uno por uno aproximadamente 60 archivos y sumar las lineas de cada uno para saber el total.
Desde yá muchisimas gracias.

Someone knows a program that adds how many lines are written in each file .prg, .fmg
It is very tedious to open approximately 60 files one by one and add the lines of each one to know the total.
Thank you very much already.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Sum of the total lines written in .prg and .fmg

Post by danielmaximiliano »

hola claudio... te puede ser util esto?

https://vivaclipper.wordpress.com/2014/ ... functions/

cargar el directorio en un array y leerlos uno por uno contando sus lineas
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Sum of the total lines written in .prg and .fmg

Post by AUGE_OHR »

hi,

it does count "all" Lines include Comments ...

Code: Select all

REQUEST HB_GT_WIN_DEFAULT           // Console
PROCEDURE MAIN
LOCAL nSum := 0, i, aDir, cName,cMemo, nLines

   aDir := DIRECTORY("*.PRG")
   FOR i := 1 TO LEN(aDir)
       cName := aDir[i][1] 
       cMemo := MemoRead( cName )
       nLines := MLCOUNT(cMemo,80) 
?      cName, nLines
       nSum += nLines
   NEXT

   aDir := DIRECTORY("*.FMG")
   FOR i := 1 TO LEN(aDir)
       cName := aDir[i][1] 
       cMemo := MemoRead( cName )
       nLines := MLCOUNT(cMemo,80) 
?      cName, nLines
       nSum += nLines
   NEXT

   ? nSum
WAIT
RETURN
have fun
Jimmy
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Sum of the total lines written in .prg and .fmg

Post by Claudio Ricardo »

Thank you very much Daniel and Jimmy
I remember that in Clipper when compiling with cl.bat it showed, but HMG's build.log doesn't.
I have to do the little program and share it.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Sum of the total lines written in .prg and .fmg

Post by danielmaximiliano »

Nunca use Clipper Claudio, en ese tiempo programaba con Qbasic y Pascal así que no sabía que el mismo tenía esa propiedad
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Sum of the total lines written in .prg and .fmg

Post by Claudio Ricardo »

Thanks to your invaluable help I made this and share it (a little messy and rushed but it works well)
Attachments
PRGInfo.zip
(1.43 MiB) Downloaded 88 times
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Sum of the total lines written in .prg and .fmg

Post by danielmaximiliano »

gracias por compartir Claudio.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Sum of the total lines written in .prg and .fmg

Post by Claudio Ricardo »

danielmaximiliano wrote: Thu Aug 12, 2021 3:05 pm Nunca use Clipper Claudio, en ese tiempo programaba con Qbasic y Pascal así que no sabía que el mismo tenía esa propiedad
Tendría que desempolvar mi vieja 486 DX4 pero en el ultimo tiempo lo usaba en DosBox desde Linux
Ahi recompilé un antiguo prg para la captura... Que nostalgia... :cry:
Captura de pantalla de 2021-08-12 150904.jpg
Captura de pantalla de 2021-08-12 150904.jpg (35.18 KiB) Viewed 794 times
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
Post Reply