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

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

Arguments:  <expC1> will determine a string of characters to be
            exchanged in <expC2>.
            <expC2> is the string in which the characters <expC1> are
            to be replaced.
            <expC3> contains the string of characters to be replaced in
            <expC2>.

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

Usage:      This function can be used to execute very complex
            replacement processes.  Each character of the <expC1>
            string, found in the <expC2> string, will be replaced by the
            corresponding character from the <expC3> string.

            If the <expC3> string is shorter than <expC1>, then the
            characters in <expC1> for which there is not a corresponding
            <expC3> character will be replaced by the last character
            from <expC3> (see example).

Library:    CT1.LIB


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

Examples:   * The figure 1 will be replaced for the
            * character "a", the figure 2 for the
            * character "b", etc.  Any figure 4 which
            * appears in the string will be exchanged
            * for the character "d".
            ? CHARREPL("1234","1x2y3z","abcd")          && "axbycz"

            * The characters a-j will be exchanged for the
            * figures 0-9, an "f" therefore , will be
            * exchanged by a "6".
            ? CHARREPL("abcdefghi","jhfdb","1234567890")&& "08642"

            * The third argument has fewer characters
            * available for the exchange than does
            * <expC1> argument.  Hence the f-j
            * characters will be replaced by the last
            * character of the "12345".
            ? CHARREPL("abcdefghi","jhfdb","12345")     && "55542"




See Also: POSREPL() RANGEREPL()

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