CT_ATTOKEN

 ATTOKEN()
 Finds the position of a token within a string

 Syntax

     ATTOKEN(<cString>,[<cDelimiter>],[<nCounter>])
        --> nPosition

 Arguments

     <cString>  Designates the character string that is passed.

     <cDelimiter>  Designates the delimiter list used to identify the
     tokens.

     <nCounter>  Designates which token's position is determined.  The
     default value is for the last token located.

 Returns

     ATTOKEN() returns the beginning position of the nth (<nCounter>) token
     within the <cString>.

 Description

     ATTOKEN() allows you to determine the beginning position of a token in
     <cString>.  This value can be extremely helpful when you work with other
     string functions.  The function uses the following list of delimiters as
     a standard:

     CHR 32, 0, 9, 10, 13, 26, 32, 138, 141

     and the characters  ,.;:!?/\<<>>()^#&%+-*

     This list can also be replaced with your own list of separators,
     <cDelimiter>.  Here are some examples of useful delimiters:

     Table 4-1: Recommended Delimiter Sequences
     ------------------------------------------------------------------------
     Description         <cDelimiter>
     ------------------------------------------------------------------------
     Pages               CHR(12)(Form Feed)
     Sentences           ".!?"
     File names          ":\."
     Numerical strings   ",."
     Date strings        "/."
     Time strings        ":."
     ------------------------------------------------------------------------

 Examples

     .  Find the beginning position of the last token:

        ? ATTOKEN("Good Day")                      // 6

     .  Find the beginning position of the fourth token:

        ? ATTOKEN("What a beautiful day.", 4)      // 18

     .  Attempt to determine the beginning position of an unavailable
        token:

        ? ATTOKEN("What a beautiful day.", 6)      // 0

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

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.