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>restfseek()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 RESTFSEEK()
 Restores the FILESEEK environment
------------------------------------------------------------------------------
 Syntax

     RESTFSEEK(<cFileSeekEnvironment>) --> cNull

 Argument

     <cFileSeekEnvironment>  Designates a string that contains the
     FILESEEK() environment, which was passed by SAVEFSEEK().

 Returns

     RESTFSEEK() always returns a null string.

 Description

     RESTFSEEK() restores a saved FILESEEK() environment.  Use both of these
     functions to run through subdirectories recursively.

 Example

     The following small program shows all the files in all directories of
     the current drive, from the root.  The GETFILES procedure can be called
     recursively:

     DO GetFiles WITH "\"                  // Starts with root directory
     RETURN

     * ----------------------------------------
     PROCEDURE GetFiles(cSearchPath)
     PRIVATE cSeekEnv                      // Picks up SEEK environment
        ?                                  // Empty line for new dir.
     * All files, all attributes
     cFile  := FILESEEK(cSearchPath + "*.*", 63)

     DO WHILE .NOT. EMPTY(cFile)

        IF cFile <> "."                    // ".." and "." are dummys
           IF ISBIT(FILEATTR(), 5)         // Subdirectory?
              cSeekEnv := SAVEFSEEK()      // Save environment
              * Recursive call with extended path!
              DO GetFiles WITH cSearchPath + cFile + "\"
              RESTFSEEK(cSeekEnv)          // Restore environment
           ELSE
              ? cSearchPath + cFile
           ENDIF
        ENDIF
        cFile := FILESEEK()                // Next file
     ENDDO

     RETURN


See Also: FILESEEK() SAVEFSEEK()

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