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

     SAVEFSEEK() --> cFileSeekEnvironment

 Returns

     SAVESEEK() returns the current FILESEEK() environment.  The information
     is needed for RESTFSEEK().

 Description

     The function saves the current FILESEEK() environment to a string.  For
     example, if the sequence "First Search - Continued Search" is
     interrupted by branching into a subdirectory, you must save these files.

 Note

     .  Be sure sufficient spare memory is available when working
        recursively at a higher level of complexity (which depends on the
        number of subdirectories).  See Examples on the following page.

 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: RESTFSEEK()

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