xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

AddASCII()

Adds a numeric value to the ASCII code of a specified character in a string.

Syntax

AddASCII( <cString>, <nValue>, [<nPos>] ) --> cNewString

Arguments

<cString>
This is a character string to manipulate.
<nValue>
A numeric value to add to a single character of <cString>.
<nPos>
Optionally, the ordinal position of the character to change can be specified as a numeric value. It defaults to Len(cString), the last character.

Return

The function adds <nValue> to the ASCII code of the specified character and returns the modified string.

Info

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

Example

// The example shows results of AddASCII()

   PROCEDURE Main
      LOCAL cString := "ABC"

      ? AddAscii( cString, 32 )     // result: "ABc"

      ? AddAscii( cString, 3, 2 )   // result: "AEC"
   RETURN

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