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

Syntax:     NUMAT(<expC1>,<expC2>[,<expN>])

Arguments:  <expC1> is the string to search <expC2>.
            <expC2> denotes the string in which to search for the
            <expC1> string.
            <expN> denotes the number of characters from which
            to start the search.

Returns:    A numeric value.
            The function returns the number of times the search string
            <expC1> was found in the string <expC2>.

Usage:      This function can be used to determine how often a
            particular <expC1> string appears in another <expC2> string.
            <expN> can be used to exclude any number of characters at
            the beginning of the <expC2> string from the search.  The
            function checks the setting of CSETATMUPA(), which will
            affect the result.  The string is searched from the left for
            each appearance of the <expC1> sequence.  If
            CSETATMUPA() is switched off (.F.) the search will be
            continued after the last character of a sequence found.  If it
            is switched on (.T.), the search will be continued after the first
            character of the sequence found.

Library:    CT1.LIB


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

Examples:   * Numbering from the first position.
            ? NUMAT("ab","abcdeabc")                    && result: 2

            * Count from the  second position, <expN>
            * denotes that one digit
            * should be skipped.
            ? NUMAT("ab","abcdeabc",1)                  && result: 1

            * The effect of CSETATMUPA() when counting the
            * "aa" string.
            * within the <expC2> string.

            CSETATMUPA(.F.)                             && Switched off
            ? ATNUM("aa","aaaab")                       && Result: 2

            CSETATMUPA(.T.)                             && Switched on
            ? ATNUM("aa","aaaab")                       && Result: 3



See Also: CSETATMUPA()

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