| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Retrieves the next token from a string.
TokenNext([@]<cString> , ;
[<nTokenPos>], ;
[@<cTokenEnv>] ) --> cToken
The function retrieves the next token from a character string prepared for the incremental tokenizer with TokenInit().
| See also: | RestToken(), SaveToken(), TokenAt(), TokenInit() |
| Category: | CT:String manipulation , Character functions , Token functions |
| Source: | ct\token2.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example lists all directories from the PATH environment variable
PROCEDURE Main
LOCAL cPath := GetEnv( "PATH" )
LOCAL nCount := 0
TokenInit( @cPath, ";" )
DO WHILE .NOT. TokenEnd()
? ++nCount, TokenNext( @cPath )
ENDDO
TokenExit()
RETURN
http://www.xHarbour.com