General information
Title:
Low level file functions -counting lines of code in proprams
Hello:
I'm writing a program to count the lines of code in my programs.
I need to be able the count the lines of code without including the comments and blank spaces. Any ideas on how to do this? THis is the code that I'm using that returns the total number of lines including comments.
gnfilehandle = fopen("mainlib.prg")
nsize = fseek(gnfilehandle,0,2)
if nsize <= 0
wait window "this file is empty!" nowait
else
=fseek(gnfilehandle, 0)
lctext = fread(gnfilehandle, nsize)
lnlines = occurs(chr(13), lctext)
? lnlines
endif
This works and returns total number of lines. Any suggestions would be greatly appreciated.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only