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>charadd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CHARADD()

Syntax:     CHARADD([@],<expC1>,<expC2>)

Arguments:  <expC1> is the string to which the values from a second
            <expC2> string are added.
            <expC2> is the string to add to <expC1>, character for
            character.

Returns:    A character string.
            The processed <expC1> string.

Usage:      CHARADD() can be used to produce simple codes within a
            string.  The function can be very useful when strings are
            coded by individual characters in a string.

Notes:      When both strings passed are the same length, the strings
            are processed character for character, with the first byte of
            <expC1> added to the first byte of <expC2>, the second
            byte of <expC1> added to the second byte of <expC2>, etc.  If
            the argument <expC2> is shorter than <expC1>, when the
            last byte of <expC2> is reached then the continuation will start
            from the first byte of <expC2> again.  However ,if <expC1>
            is shorter than  <expC2>, the process will stop at the end of
            <expC1> The addition can produce values larger than 256.
            A new value will then be formed in accordance with the
            formula:

            (ASC(character1)+ASC(character2))%256

Library:    CT1.LIB


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

Examples:   * The value 1 is added to each character
            ? CHARADD("01234",CHR(1))                   && "12345"

            * If the value 255 is added to each
            * character then that will correspond
            * to a subtraction of 1.
            ? CHARADD("12345",CHR(255))                 && "01234"



See Also: ADDASCII()

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