xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

TokenEnd()

Tests if tokens can still be found with TokenNext().

Syntax

TokenEnd( [@<cTokenEnv>] ) --> lTokenEnd

Arguments

@<cTokenEnv>
Optionally, a character string holding a local tokenizer environment can be passed. It is obtained via the fourth parameter of TokenInit(). <cTokenEnv> must be passed by reference. If <cTokenEnv> is omitted, the function uses the global tokenizer environment.

Return

The function returns .T. (true) when a new call to TokenNext() returns a token, otherwise .F. (false) is returned.

Info

See also:TokenInit(), TokenNext()
Category: CT:String manipulation , Character functions , Token functions
Source:ct\token2.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example is a typical usage scenario for TokenEnd(). It delivers
// the termination condition for extracting all tokens from a character
// string within a DO WHILE loop.

   PROCEDURE Main
      LOCAL cPath  := GetEnv( "PATH" )
      LOCAL nCount := 0

      TokenInit( @cPath, ";" )

      DO WHILE .NOT. TokenEnd()
         ? ++nCount, TokenNext( @cPath )
      ENDDO

      TokenExit()
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe