Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>addascii()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ADDASCII()

Syntax:     ADDASCII([@]<expC>,<expN1>[,<expN2>])

Arguments:  <expC> is the character string to be processed.
            <expN1> denotes the value to add to the ASCII value in the
            <expC> position.
            <expN2> denotes the position of the character to which
            <expN1> value should be added.

Returns:    A character string.
            The altered string is returned.

Usage:      This function can be very useful when calling procedures via
            macros.  It will be possible to change the string forming the
            macro with ADDASCII() without having to involve functions
            such as LEFT(), RIGHT(), ASC() or SUBSTR() (see
            examples).  This function is also capable of subtracting a
            value, although a conversion is needed for this purpose.  If it
            is required to convert from lower case to upper case, it is
            necessary to subtract 32.  See following formula:

            CHR((ASC(<char>)+256-difference)%256)

Notes:      The value <expN1> is added to the ASCII value of the last
            character of the <expC> string, if the optional <expN2>
            argument is missing.  The <expC> string will remain
            unchanged, if the indicated <expN2> position is outside
            <expC>.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * The value of 1 is added once to the
            * penultimate character, then to the
            * last character.
            ? ADDASCII("macro21",1,6)           && "macro31"
            ? ADDASCII("macro21",1)             && "macro22"

            * CHR(ASC("2") +1)   Produces "3" ect.

            * However it will be possible to subtract
            * 32 is the difference between lower and upper
            * cases, hence:
            * CHR((ASC("m")+256-32)%256)

            ? ADDASCII("macro21",224,1)         && "macro21"



Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson