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

Syntax:     ATNUM(<expC1>,<expC2>[,<expN1>][,<expN2>])

Arguments:  <expC1> is the string being sought in the <expC2> string.
            <expC2> denotes the string in which the <expC1> string
            should be sought.
            <expN1> denotes the number of the appearance of <expC1>
            in <expC2> to be determined.
            <expN2> denotes the position in the string from which to
            start the search.

Returns:    A character string.
            The function will return to the position where the string being
            within the <expC2> string starts.  The function will
            return the value of 0 if it is not possible to determine the
            corresponding position.

Usage:      This function will return the initial position of the <expN1>th
            appearance of <expC1> within the <expC2> string.  The
            function will check the setting of CSETATMUPA() which will
            produce different results accordingly.  ATNUM() will search
            each appearance of this string from the left, to determine the
            of the <expN1> appearance of <expC1>.  If CSETATMUPA() is
            switched off, then the search will be continued after the last
            character of the sequence most recently found.  Otherwise,
            the search will be continued after the first character of the
            sequence most recently found.  This function will start the
            search at the first character of <expC2>, if the <expN2>
            argument is not specified.  Otherwise, <expN2> symbols
            relative to the start of the string will be exempted from the
            search.

Notes:      The function will determine the last appearance of the
            sequence specified via <expC1>, if no value has been
            specified for <expN1>.

Library:    CT1.LIB


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

Examples:   m Search the last appearance
            ? ATNUM("bc","abcdabc")             && Result: 7

            * Search the first appearance
            ? ATNUM("bc","abcdabc",1)           && Result: 2

            * Search the first occurrence skipping the
            * first three characters.
            ? ATNUM("bc","abcdabc",3)           && Result: 7

            * The effect of CSETATMUPA() in the search of
            * the last appearance of "aa" in "aaa"
            CSETATMUPA(.F.)                     && Switched off
            ? ATNUM("aa","aaa")                 && Result: 1

            CSETATMUPA(.T.)                     && Switched on
            ? ATNUM("aa","aaa")                 && Result: 2



See Also: CSETATMUPA()

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