REM Counts code v1.0a PD 2001.
DEFINT A-Z
REM $INCLUDE: 'BC7.INC'
COLOR 15, 0
PRINT "Code counter v1.0:"
FOR FileType = 1 TO 3
   SELECT CASE FileType
   CASE 1
      Filespec$ = "*.bi"
   CASE 2
      Filespec$ = "*.inc"
   CASE 3
      Filespec$ = "*.bas"
   END SELECT
   PRINT "Counting ";Filespec$
   Filename$ = DIR$(Filespec$)
   WHILE LEN(Filename$)
      CLOSE
      OPEN Filename$ FOR INPUT AS #1
      TotalFiles# = TotalFiles# + 1#
      WHILE NOT EOF(1)
         LINE INPUT #1, InputLine$
         TotalLines# = TotalLines# + 1#
         TotalBytes# = TotalBytes# + CDBL(LEN(InputLine$)) + 2#
      WEND
      Filename$ = DIR$
   WEND
NEXT
COLOR 14, 0
PRINT "Totals:"
COLOR 15, 0
PRINT Format$(TotalFiles#,"#,##0;;"); " files."
PRINT Format$(TotalLines#,"#,##0;;"); " lines."
PRINT Format$(TotalBytes#,"#,##0;;"); " bytes."
COLOR 7, 0
PRINT "Exiting to system:"
END
