CT_TOKENEND

 TOKENEND()
 Determines if more tokens are available in TOKENNEXT()
------------------------------------------------------------------------------
 Syntax

     TOKENEND() --> lEndToken

 Returns

     TOKENEND() returns .T. after the last token has been queried with
     TOKENNEXT().

 Description

     Reviewing the return value of TOKENNEXT(), as the final condition for
     tokenizing, is not always definitive.  The end of one cycle is shown
     here as a null string, which is returned just like an "empty" token
     (empty line).

     By contrast, TOKENEND() always returns definite information if there are
     more tokens to be returned by TOKENNEXT().  This makes TOKENEND() ideal
     for use as a loop condition.

 Example

     Break up text into individual lines.  The text is initialized so that
     two consecutive (3. Parameter) CR/LF sequences return a null string:

     TOKENINIT(TextString, CHR(13) + CHR(10), 2)

     DO WHILE .NOT. TOKENEND()
        Line  :=  TOKENNEXT(TextString)

        ? "Line - " + Line
     ENDDO

See Also: TOKENINIT() TOKENNEXT()

 

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.