xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FCharCount()

Counts the number of characters in a text file ignoring white space characters.

Syntax

FCharCount( <cFileName> ) --> nCharCount

Arguments

<cFileName>
This is a character string holding the name of the text file whose characters to count. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory.

Return

The function returns the number of non white space characters contained in a text file.

Description

The function counts the characters in an ASCII text file but ignores white space characters. These are Tab (Chr(9)), Line Feed (Chr(10)), Carriage return (Chr(13)) and Blank space (Chr(32)).

Info

See also:FCreate(), FOpen(), FLineCount(), FParse(), FWordCount(), MemoLine(), MlCount()
Category: File functions , xHarbour extensions
Source:rtl\fparse.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays the number of characters of
// the example.

   PROCEDURE Main
      LOCAL cFileName := "FCharCount.prg"

      ? FCharCount( cFileName )        // result: 141

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe