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

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

Arguments:  <expC1> is the string to search.
            <expC2> is the list of separators used to detect a token.
            <expN> denotes the number of tokens to be returned
            from <expC1>.

Returns:    A character string.
            The token specified by <expN> or the last token in the
            absence of the argument.

Usage:      The TOKEN() function can be used to take apart date and
            time details, sentences, file names and paths, etc.  The
            <expN> token is returned if it is specified.  Otherwise the
            last token is returned.  By default, the function uses the list
            of separators shown under Note:.  This list is replaced with
            the <expC2> list of separators when spesified.

Notes:      The standard list of separators consists of the following
            characters:

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

            Some examples of useful separators:

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

Library:    CT1.LIB


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

Examples:   * The last token in a string.
            ? TOKEN("CLIPPER")                          && "CLIPPER"
            ? TOKEN("  ,    CLIPPER .    ")             && "CLIPPER"
            ? TOKEN("CLIPPER COMPILER!")                && "COMPILER"

            * The first token in a string.
            ? TOKEN("CLIPPER",1)                        && "CLIPPER"
            ? TOKEN("CLIPPER COMPILER!",1)              && "CLIPPER"

            * The third token.
            ? TOKEN("This is a test.",3)                && "a"

            * There are only four tokens available.
            ? TOKEN("This is a test.",5)                && ""




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

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