Expression.Tokenize
- Mise à jour2025-07-21
- Temps de lecture : 2 minute(s)
Expression.Tokenize
Syntax
Expression.Tokenize( options, initialParseState)
Return Value
The return value represents the parsing state at the end of the expression.
If you individually tokenize each displayed line of an expression wrapped to multiple lines by a user interface control, pass this value to the initialParseState parameter of this method when you tokenize the next visible line.
Purpose
This method parses the expression text to identify the tokens that represent operators, identifiers, and constants. The capability to parse the expression into component tokens is useful for specialized purposes, such as implementing expression syntax coloring. Typically, you do not call this method.
Parameters
options As Long
[In] Pass TokenizeOptions_NoOptions to specify the default behavior, or pass one or more TokenizeOptions constants. Use the bitwise-OR operator to specify multiple options. The Expression object retains the options you specify to use whenever it must tokenize the expression in the Expression.Validate and Expression.Evaluate methods.
initialParseState As Long
[In] Pass 0 if you are tokenizing a complete expression. Typically, you pass 0 to this parameter.
If you separately tokenize each visible line in an expression, pass 0 to tokenize the first visible line and pass the return value of this method from tokenizing the previous line to tokenize a subsequent line.