Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - token() return a token from a string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 token()             Return a token from a string
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func char token extern
   param const char cString, ;
         value byte bSeparator, ;
         value uint uPosition

 Arguments
   cString is a string to scan for tokens.

   bSeparator is a token separator character.

   uPosition is the index of token to retrieve.

 Return
   The uPosition-th token from cString.

 Description
   The token() function retrieves a token from the input string, as
   specified by the token separator character and the token position
   parameters. Consecutive occurrences of the separator character result in
   separate empty tokens.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_token
   vardef
      char cString
      uint n
   enddef
   cString := "one two three four five six"
   for n := 1 to 6
      ? token( cString, ' ', n )              // get tokens
   next
   endproc

   proc main
   Test_token()
   endproc

See Also: tokenptr() word()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson