      SUBROUTINE REUSER
C     RENBR(REUSR3/DIALOG OF FILE NAMES 1 PER LINE)
C
C     DONALD BARTH, HARVARD BUSINESS SCHOOL
C
C     THIS  VERSION OF THE  USER COMMAND  DIALOG  PROCESSOR
C     FOR RENBR ASKS THE USER TO SUPPLY THE NAMES OF ONE OR
C     BOTH OUTPUT FILES AND THE NAMES  ONE  OR  MORE  INPUT
C     FILES.  RENUMBERING IS PERFORMED IF, AND ONLY IF, THE
C     USER SUPPLIES A NAME FOR THE RENUMBERED OUTPUT  FILE.
C     LISTING  IS  PERFORMED  IF,  AND  ONLY  IF,  THE USER
C     SUPPLIES A NAME FOR THE LISTING FILE.  A SINGLE INPUT
C     FILE  CAN  CONTAIN  MANY PROGRAMS AND/OR ROUTINES, OR
C     MERELY A PORTION OF A PROGRAM OR ROUTINE.  ALL  INPUT
C     FILES  ARE  COPIED  INTO  EACH  OF  THE OUTPUT FILES.
C     THE LIST OF INPUT FILES IS  TERMINATED  BY  TYPING  A
C     BLANK  INPUT  FILE  NAME.  AFTER TYPING A BLANK INPUT
C     FILE NAME, A NEW SET OF OUTPUT AND INPUT FILES CAN BE
C     ESTABLISHED.   PROCESSING  IS  TERMINATED  BY  TYPING
C     BLANK NAMES FOR BOTH POSSIBLE OUTPUT FILES.
C
      COMMON/RNBONE/I     ,IALPHA,IBASE ,IBR   ,IBREAK,
     1IEND  ,IENTER,IEOF  ,IERR  ,IFILL ,IFORM ,IHIHDO,
     2IIN   ,ILEVEL,ILPT  ,INCR  ,INCSAV,INDENT,INITOC,
     3INRCPY,INRFND,INIOPR,IOUT  ,IPAGE ,IPASS ,ISPACE,
     4ISPLIT,ISPR  ,ISTART,ISTN  ,ITAB  ,ITBL  ,ITITLE,
     5ITTY  ,J     ,JBGN  ,JBREAK,JEND  ,JEOF  ,JFORM ,
     6JIN   ,JIN1  ,JLEVEL,JMPBGN,JMPEND,JOUT  ,JPASS ,
     7JSPLIT,JSTN  ,JTAB  ,JTTY  ,K     ,KLEVEL,KNDGRP,
     8KNT   ,MAXPRT,KNTONE,KNTPNT,KNTSPL,KNTTOC,KNTTWO,
     9KOMENT,KOMKNT,KOMNUM,KONTRL,KOUNT ,KPAGE
      COMMON/RNBTWO/MASTER,KPYEND,KSTN  ,KTAB  ,KUTNUM,
     1KUTPNT,KUTSPL,L     ,LCLNUM,LCLPNT,LCLSPL,LEFT  ,
     2LIKE  ,LMTTOC,LOW1  ,LOW2  ,LOWDO ,LOWER ,
     3LPTTTY,LRGSPL,LRGNUM,LRGPNT,LRGTOC,LSTKNT,LSTN  ,
     4LSTSTN,LTAB  ,M     ,MANY  ,MAXEND,MAXLIN,MAXPNT,
     5MAXSPL,MAXTOC,MID   ,MOST  ,MOVE  ,MSTN  ,MTAB  ,
     6N     ,NCD   ,NEED  ,NEWNUM,NEWSTN,NONFOR,
     7NSTN  ,NUM   ,LOWTOC,NXTLST,IPOINT,JPOINT,NXTEND,
     8KEND  ,NTAB  ,IFREAR,KPOINT,KBGN  ,LEND  ,LNGNAM,
     9LOWSHO,ININAM,JTBL  ,NOWTOC,LPOINT,INIPRT,JOBNUM
      COMMON/RNBTHR/MODBAS,MODINC,MODMAX,MODMIN,MODNEW,
     1MODOLD,KMDMIN,KMDMAX,ITRACE,LNGCOM,LNGNXT,KPASS
      COMMON/RNBFOU/INRSTR(21)  ,JPNT  (10)  ,MCHOPR(50)  ,
     1 NNEW  (1000),NOLD  (1000),NOTOPR(50)  ,NUMPNT(5000),
     2 NUMPRS(515) ,NUMTOC(112) ,NUMTYP(7)   ,LINREF(9)
      COMMON/RNBFIV/LTRCCC,LTRCLN,LTREQL,LTREXC,LTRHHH,
     1LTRLFT,LTRMNS,LTRPLS,LTRQOT,LTRRIT,LTRSEM,LTRSLA,
     2LTRSPC,LTRTAB,LWRCCC,LWRHHH,LTRNOW,LTR1ST,LTR2ND,
     3LTRREF,LTRDDD,LWRDDD,LTREEE,LWREEE,LTRDOT,LTRSTR
      COMMON/RNBSIX/LTRABC(26)  ,LTRBGN(5)   ,LTRBIG(2211),
     1 LTRDGT(10)  ,LTREND(3)   ,LTRFLG(7)   ,LTRKEY(5)   ,
     2 LTROPR(50)  ,LTRPRS(247) ,LTRSPL(2000),LTRTOC(168) ,
     3 LTRTOP(117) ,LTRTTL(5)   ,LTRTYP(55)  ,LTRUSE(6)   ,
     4 LWRABC(26)  ,LWRBGN(5)   ,LWREND(3)   ,LWRFLG(7)   ,
     5 LWRKEY(5)   ,LWRPRS(247) ,LWRTTL(5)   ,LTRNAM(10)  ,
     6 LTRSRT(26)  ,LWRSRT(26)  ,LTR120(120)
      DOUBLE PRECISION FILSRC,FILRNB,FILLPT,FILSPC
      DATA FILSPC/'          '/
C
C     DETERMINE IF THIS IS FIRST TIME THIS ROUTINE CALLED
      JPASS=1
      IF(MASTER.GT.1)GO TO 8
      IPAGE=0
      INCR=0
      IF(MASTER.EQ.1)WRITE(ITTY,1)
    1 FORMAT(14H RENBR (01/79)/1X)
C
C     OPEN LISTING FILE
    2 WRITE(ITTY,3)
    3 FORMAT('    OUTPUT LISTING FILE: ',$)
      READ(JTTY,11)FILLPT
      IF(FILLPT.EQ.FILSPC)GO TO 4
      IPAGE=1
      OPEN(UNIT=ILPT,FILE=FILLPT,ACCESS='SEQOUT',
     1DEVICE='LPT')
C
C     OPEN RENUMBERED OUTPUT FILE
    4 WRITE(ITTY,5)
    5 FORMAT(' OUTPUT RENUMBERED FILE: ',$)
      READ(JTTY,11)FILRNB
      IF(FILRNB.EQ.FILSPC)GO TO 6
      INCR=1
      OPEN(UNIT=IOUT,FILE=FILRNB,ACCESS='SEQOUT')
      GO TO 9
    6 IF(IPAGE.NE.0)GO TO 9
      IF(MASTER.NE.1)GO TO 16
      WRITE(ITTY,7)
    7 FORMAT(' AT LEAST 1 OUTPUT FILE MUST BE SPECIFIED')
      GO TO 2
C
C     OPEN INPUT FILE
    8 CLOSE(UNIT=IIN)
    9 WRITE(ITTY,10)
   10 FORMAT('      INPUT SOURCE FILE: ',$)
      READ(JTTY,11)FILSRC
   11 FORMAT(1A10)
      IF(FILSRC.EQ.FILSPC)GO TO 14
      OPEN(UNIT=IIN,FILE=FILSRC,ACCESS='SEQIN',ERR=12)
      GO TO 17
   12 WRITE(ITTY,13)
   13 FORMAT(' FILE CAN NOT BE READ')
      GO TO 9
   14 IF(MASTER.NE.1)GO TO 16
      WRITE(ITTY,15)
   15 FORMAT(' FIRST INPUT FILE MUST BE SPECIFIED')
      GO TO 9
C
C     RETURN TO CALLING PROGRAM
   16 JPASS=0
   17 RETURN
C349844660542':$
      END

