>Is there any way to know how many lines of code we've written in a VFP app?
For program files, you could count CHR(13)+CHR(10) pairs (let´s call them CRLF) in the text, though there are some problems:
1. Tabs are a bother; replace all CHR(9) with " "
2. Spaces at the beginning of a line can hinder some of the ideas below, so you could replace CRLF+" " with CRLF until there are no more CRLF+" " left. (See (7) below.)
3. Spaces at the end of a line are also a bother; replace " "+CRLF with CRLF until there are no more left. (See (6) below.)
4. empty lines shouldn´t be counted. Replacing CRLF+CRLF with CRLF until there are no more CRLF+CRLF left works.
5. Put the entire code in uppercase using UPPER(). (See (7) below.)
OK! Now count CRLF pairs, but...
6. continuation lines shouldn´t be counted. Count ";"+CRLF and deduct that number from the CRLF count. (This works because of step (3) above.)
7. all comment lines shouldn´t be counted either. Count CRLF+"*", CRLF+"&&", and CRLF+"NOTE", and subtract that number too. (This works because of steps (2) and (5) above.)
This should be a good approximation!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement