|
Strict
Framework Brl.StandardIO
Import Brl.FileSystem
Function ProcDir(Dir$)
Local lines
For Local a$ = EachIn LoadDir(Dir)
Local file$ = Dir + "/" + a
If FileType(file) = FILETYPE_FILE
If a <> "PrgLinec.bmx" And ExtractExt(a) = "cs"
Local n = FileLinen(LoadString(file), a)
lines :+ n
PrintData a, n, FileSize(file)
EndIf
Else
lines :+ ProcDir(Dir + "/" + a)
EndIf
Next
Return lines
EndFunction
Print ProcDir(CurrentDir())
Input ""
Function FileLinen(s$,f$)
Local linen=0
Local bytes:Byte Ptr=s.ToCString()
For Local a=0 To s.Length-2
If bytes[a]=13 And bytes[a+1]=10 linen:+1
If bytes[a]=13 And bytes[a+2]=10 linen:+1
If bytes[a]=13 And bytes[a+2]=0 linen:+1
If bytes[a]=10 And bytes[a+2]=0 linen:+1
Next
MemFree bytes
Return linen+1
EndFunction
Function PrintData(f$,linen,b)
Print f+": "+StrMul(" ",28-Len(f)-Len(String(linen)))+linen+"line "+StrMul(" ",6-Len(String(b)))+b+"b"
EndFunction
Function StrMul$(f$,n)
Local out$=""
For Local a=1 To n
out:+f
Next
Return out
EndFunction
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.