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

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

Arguments:  <expC1> is the string to search for tokens (words).
            <expC2> is the separating list of characters used for
            detecting the token.
            <expN> denotes the occurrence of the token to search for.

Returns:    A numeric value.
            The initial position of the <expN> token with the <expC1>
            string.

Usage:      ATTOKEN() can be used to determine the starting position of
            a token in a <expC1> string.  This value can be very helpful
            when used in conjunction with other string functions.  The
            function will normally use  the list of separating characters
            shown under note:.  The list may be replaced by an
            individual <expC2> list of separating characters.

Notes:      In the absence of the <expN> argument, the function will
            return the initial position for the last token in <expC1>.  The
            standard list of separating characters consists of the following
            characters:

            CHR 0, 9, 10, 13, 26, 32, 238, 141
            and the characters ,.;:!?/ ()#&%+-*

            Some examples of useful separating characters:

            Pages                       CHR(12) (FormFeed)
            Sentences                   "!?"
            File names                  ":."
            Numerical strings           ",."
            Data strings                "/."
            Time strings                ":."

Library:    CT1.LIB


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

Examples:   * The initial position of the last token
            ? ATTOKEN("Good day")               && 6

            * The initial position of the fourth token
            ? ATTOKEN("What a beautiful day",4) && 18

            * An attempt to determine the initial
            * position of a non-existing token
            ? ATTOKEN("What a beautiful day",6) && 0



See Also: NUMTOKEN() TOKEN() TOKENLOWER() TOKENUPPER()

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