Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>resttoken()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 RESTTOKEN()
 Recreates an incremental tokenizer environment
------------------------------------------------------------------------------
 Syntax

     RESTTOKEN(<cTokenEnvironment>) --> cEmptyString

 Argument

     <cTokenEnvironment>  Designates a character string returned by the
     SAVETOKEN() function.

 Returns

     RESTTOKEN() always returns an empty string.

 Description

     The internal environment for the incremental tokenizer can be restored
     using RESTTOKEN().  RESTTOKEN() does the opposite of the SAVETOKEN()
     function.

 Note

     .  <nTokenEnvironment> must originate from the current program
        run; for example, it cannot have been restored from a (.mem) file.

 Examples

     .  Here is an incremental tokenizer.  Text is broken into
        individual lines, and each line is broken into words:

        TOKENINIT(@cTextString, CHR(13) + CHR(10), 2)
        cLine   :=  TOKENNEXT()

        DO WHILE .NOT. TOKENEND()
           cLine  :=  TOKENNEXT(cTextString)
           WORD(cLine)
        ENDDO

     .  The function then breaks the lines into words:

        FUNCTION WORD(cLine)

           cOldEnv  := SAVETOKEN()
           TOKENINIT(@cLine, " .,-:;")

           DO WHILE .NOT. TOKENEND()
              cWord  :=  TOKENNEXT(cLine)
              ? cWord
           ENDDO
           RESTTOKEN(cOldEnv)
           RETURN("")


See Also: SAVETOKEN() TOKENINIT() TOKENNEXT()

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