REM Counts code v1.1a PD 2001.
DEFINT A-Z
REM $INCLUDE: 'BC7.INC'
COLOR 15, 0
PRINT "Code counter v1.1:"
FOR FileType = 1 TO 4
   SELECT CASE FileType
   CASE 1
      Filespec$ = "*.asm"
   CASE 2
      Filespec$ = "*.bi"
   CASE 3
      Filespec$ = "*.bas"
   CASE 4
      Filespec$ = "*.inc"
   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
