[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson