ASCIISum()

ASCIISum()

Calculate the sum of the ASCII values of the characters in a string

Syntax

      ASCIISum( <cString> ) --> nASCIISum

Arguments

<cString> the string to be processed

Returns

<nASCIISum> sum of the ASCII values in <cString>

Description

The ASCIISum() function sums up the ASCII values of the characters in <cString>. Be aware that the function is not position sensitive, i.e. a change of position of a certain character in the string does not change the ascii sum.

Examples

      ? ASCIISum( "ABC" ) // -->  197
      ? ASCIISum( "ACB" ) // -->  197

Tests

      ASCIISum( Replicate( "A", 10000 ) ) == 650000
      ASCIISum( "0123456789" ) == 525
      ASCIISum( NIL ) == 0

Compliance

ASCIISum() is compatible with CT3’s ASCIISum().

Platforms

All

Files

Source is ASCIISum.c, library is ct3.

Seealso

CHECKSUM()

Advertisements

2 responses to “ASCIISum()

  1. Pingback: Harbour String Functions | Viva Clipper !

  2. Pingback: Harbour All Functions – A | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s