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