# ------------------------------------------------------------------------- #
# Function to count:                                                        #
# Lines of code (real lines of code)                                        #
# Lines that start with Comment or are blank                                #
# Total Line in File                                                        #
# ------------------------------------------------------------------------- #
#
public function cloc ( in fileX, inout lines_code, inout lines_blank_or_comment, inout total_LOC  )
{
	auto line;

	# Initialize variables ...
	lines_code = 0;

	file_open ( fileX, FO_MODE_READ );

	while ( file_getline( fileX, line ) == 0 )
	{
		# Blank or Coment lines ...
		if ( match( line, "[^#]" ) == 1 )
		{
			lines_blank_or_comment++;
		}
		else
		{
			lines_code++;
		}
	}

	total_LOC = lines_code + lines_blank_or_comment;

	file_close ( fileX );
}


rc1 = cloc( "C:\\Junk1\\script", LOC, BlankOrComment, TLOC );

printf ( "Total Number of lines of code: %s\r\n", LOC );
printf ( "Total Comment or blank lines in code: %s\r\n", BlankOrComment );
printf ( "Total lines in file: %s\r\n", TLOC );
