[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson