C--------------------------------------------------------------------------
	SUBROUTINE WRITEALL(lflag,*)
C
C	WRITE OUT UNSAVED FILES IN DEFAULT FORMAT
C
	include 'shared$common'
	LOGICAL LFLAG,ans
	DO i=1,MFILE
	  IF (.not. fexists(i)) then
	    IF (prompt .and. lflag) then
	      WRITE (lo,'(A,i2,a)') '$WRITE FILE #',i,' (Default=Y): '
	      READ (lo,'(a1)',end=3) ans
	      IF (ans .ne. 'n' .and. ans .ne. 'N') CALL WRITESUB(i,*3)
	    else
	      CALL WRITESUB(i,*3)
	    ENDIF
	  ENDIF
	ENDDO
	RETURN
3	return 1
	END
