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

Syntax:     NUMTOKEN(<expC1>[,<expC2>])

Arguments:  <expC1> is the string to be searched for tokens (words).
            <expC2> is the list of separator for detecting tokens.

Returns:    A numeric value.
            The number of tokens contained in <expC1> string.

Usage:      Use NUMTOKEN() to establish the number of words (or
            tokens) contained in a string.  The function will use the list
            of separators indicated under note: as standard.  This list
            may be replaced by the <expC2> list of separators.

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:   * A string is searched using the standard
            * separator list.
            ? NUMTOKEN("Good day!")                     && Result: 2

            * It is also possible to specify a private
            * list of separators for specific purposes.
            * The result of the following example is 3
            * because the separating list contains only
            * 3 characters ".!?".
            ? NUMTOKEN("Yes! That's it.  Maybe not?")
                                                        && Result: 5

            ? NUMTOKEN("Yes! That's it.  Maybe not?",".!?")
                                                        && Result: 3




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

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