formulatokencount(
formulatokencount(
FORMULA
)

The formulatokencount( function returns a count of the number of tokens in a formula.

Parameters

This function has one parameter:

formula – is the formula to be analyzed. If the formula is specified inline in the function itself, it must be quoted (see Quotes). Otherwise, you can pre-store the formula in a field or variable.

Description

The function returns a count of the number of tokens in a formula.

For example, the formula

    x + y

has three tokens:

    x
    +
    y

so

    formulatokencount("x + y") ☞ 3

If a formula has a syntax error, it doesn’t contain any tokens, as shown in this example.

    formulatokencount("x +") ☞ 0

See Also

- formulafields( -- returns a list of fields used in a formula.
- formulaidentfiers( -- returns a list of identifiers (fields and variables) used in a formula.
- formulavalue( -- calculates the result of a formula based on data in the current record of any open database. This is similar to the fieldvalue( function, but allows any formula to be used, rather than just a single field.
- formulavariables( -- returns a list of variables used in a formula.

History

Version | Status | Notes
10.2 | New | New in this version.