xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

ASCIISum()

Sums the ASCII codes of all characters in a string.

Syntax

ASCIISum( <cString> ) --> nASCIISum

Arguments

<cString>
This is the character string to process.

Return

The function returns the sum of the ASCII codes of all characters of <cString>.

Info

See also:Asc(), CheckSum()
Category: CT:String manipulation , Character functions
Source:ct\asciisum.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates the return value of AsciiSum().

   PROCEDURE Main
      LOCAL cString := "ABC"
      LOCAL cChar

      FOR EACH cChar in cString
         ? Asc( cChar )
      NEXT                   ** Result:
                             //          65
                             //          66
                             //          67

      ? AsciiSum( cString )  // result: 198
   RETURN

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