>
>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!
Comments _should_ be counted, though separately. You should insert one CRLF before the beginning of any source file, just in case the first line is a comment.
Of course, this shouldn't be done on live files - append them into a memo of a discardable cursor and manipulate there (or in VFP6, just FileToStr).