home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmsmp.zip / SAVEALL.E < prev    next >
Text File  |  1996-01-30  |  1KB  |  35 lines

  1. ; Save all modified files in the ring,
  2. ;   Larry Margolis
  3.  
  4. compile if not defined(SMALL)  -- If being externally compiled...
  5. tryinclude 'MYCNF.E'               -- Include user's configuration
  6. compile if not defined(NLS_LANGUAGE)  -- If no language set,
  7. const
  8.    NLS_LANGUAGE = 'ENGLISH'           -- assume English.
  9. compile endif
  10. include NLS_LANGUAGE'.e'              -- Need this to get UNNAMED_FILE_NAME
  11.  
  12. defmain                        --  ... set up so can be implicitly executed.
  13.    'saveall'
  14. compile endif
  15.  
  16. defc saveall =
  17.    getfileid startid
  18.    do i = 1 to FilesInRing(2)     -- Prevent looping forever.
  19.       if .modify then
  20.          if leftstr(.filename, 15) = ".command_shell_" |
  21.             wordpos(leftstr(.filename, 5), ".DOS .tree") then
  22.             .modify = 0
  23.          else
  24.             if .filename = UNNAMED_FILE_NAME then
  25.                refresh  -- Show file, because Save As dialog will be presented.
  26.             endif
  27.             'save'
  28.          endif
  29.       endif
  30.       nextfile
  31.       getfileid fid
  32.       if fid=startid then leave; endif
  33.    enddo
  34.    activatefile startid  -- Make sure we're back where we started
  35.