TOKENEND()

Check whether additional tokens are available with TOKENNEXT()

Syntax

TOKENEND ([<@cTokenEnvironment>]) -> lTokenEnd

Arguments

<@cTokenEnvironment> a token environment

Returns

<lTokenEnd> .T., if additional tokens are available

Description

The TOKENEND() function can be used to check whether the next call to TOKENNEXT() would return a new token. This can not be decided with TOKENNEXT() alone, since an empty token cannot be distinguished from a "no more" tokens. If the parameter <@cTokenEnvironment> is supplied (must be by reference), the information from this token environment is used, otherwise the global TE is used. With a combination of TOKENEND() and TOKENNEXT(), all tokens from a string can be retrieved successivly (see example).
Examples
      tokeninit ("a.b.c.d", ".", 1)  // initialize global TE
      do while (!tokenend())
        ? tokennext ("a.b.c.d")  // get all tokens successivly
      enddo
Status

Ready

Compliance

TOKENEND() is compatible with CTIII's TOKENEND(), but there are is an additional parameter featuring local token environments.

Platforms

All

Files

Source is token2.c, library is libct.

See Also