); the user may remove this', & 'and refine the presentation after conversion. Alternatively,', & 'pairs ofanddirectives may be pre-inserted', & 'in the HELP file to protect tables, etc., and formatted', & 'output produced (the default).', & ' ', &'Usage : the program expects a Help file prefix, eg. "FOOBAR".', & 'It will then read FOOBAR.HLP, creating the Hypertext files', &'FOOBAR.HTML,FOOBAR_1.HTML,FOOBAR_2.HTML, etc. plus FOOBAR.HREF,', & 'a list of the references created which may be used to add', & 'further cross-references manually.', & 'Depending on the format of the original HLP file, the', & 'hypertext output may start either in FOOBAR.HTML or in', & 'FOOBAR_1.HTML.', ' '/ INTEGER MAXLEVEL PARAMETER (MAXLEVEL=9) ! max. no. of levels in HLP file C CHARACTER*132 line, line2 CHARACTER*132 title CHARACTER*80 filenm CHARACTER*40 cpath INTEGER lpath CHARACTER*30 prefix CHARACTER*80 word, words(MAXLEVEL) CHARACTER*34 part, parts(MAXLEVEL) CHARACTER*7 ref CHARACTER*1 pre_flag INTEGER wns(MAXLEVEL) INTEGER ios, level, prev_level, k, j INTEGER wn, fln, pxn, tn INTEGER partn, nl, refn INTEGER nch, nquotes C The qpre flag is .TRUE. if a "" (preformat) command has been C written to the output file and is active. Several HTML commands are C not legal inside a' qpre = .FALSE. END IF DO 220 k = prev_level, level + 1, -1 IF ( qdir(k) ) THEN WRITE (10+k,121) '' qdir(k) = .FALSE. END IF WRITE (10+k,121) '...block, so we must track this state. LOGICAL qpre C The command can only be issued ifwas issued somewhere C in the current file. Hence its status must be tracked on a per level C basis. LOGICAL qdir(0:MAXLEVEL) DATA qdir/.FALSE.,MAXLEVEL*.FALSE./ C--- 100 PRINT *, 'Enter Help file prefix (blank for help):' READ 101, pxn, prefix 101 FORMAT (q,a) IF ( prefix.EQ.' ' ) THEN WRITE (*,111) descrip 111 FORMAT (1X,A) GOTO 100 END IF OPEN (UNIT=1,FILE=prefix(:pxn)//'.hlp',STATUS='old', & READONLY, IOSTAT=IOS) IF ( IOS.NE.0 ) THEN WRITE(*,*) 'Unable to open file: ',prefix(:pxn)//'.hlp' GOTO 100 END IF OPEN (UNIT=2,FILE=prefix(:pxn)//'.href',STATUS='new', & CARRIAGECONTROL='list') C PRINT *, 'Default to pre-formatted HTML (y/n) ?' READ 121, pre_flag 121 FORMAT (a) IF ( pre_flag.EQ.'y' ) pre_flag = 'Y' C PRINT *, 'Enter optional href filename path (default blank):' READ 101, lpath, cpath IF ( lpath.EQ.0 ) THEN C Avoid trouble with cpath(1:0); squash will eat extra space lpath = 1 cpath = ' ' END IF C prev_level = 0 level = 0 partn = 0 refn = 0 nquotes = 0 WRITE (2,*) 'List of references for ', prefix C Create base file filenm = cpath(1:lpath) // prefix // '.html' CALL SQUASH(filenm,fln) CALL OPHTML(10+level, filenm, fln, prefix, pxn) qpre = .FALSE. 200 READ (1,101,END=900) nch, line nl = nl + 1 IF ( nch.EQ.0 .OR. line.EQ.' ' ) THEN C Paragraph IF ( level.GT.0 ) THEN IF ( qpre ) THEN WRITE (10+level,121) ELSE WRITE (10+level,121) ' ' END IF END IF GOTO 200 END IF C IF ( (line(1:1).LT.'1' .OR. line(1:1).GT.'9') .OR. & (line(2:2).NE.' ' .AND. line(2:2).NE.CHAR(ITAB)) ) GOTO 300 READ (line,201,ERR=300) level 201 FORMAT (bn,i1) C word = line(2:nch) wn = nch - 1 CALL SQUASH(word, wn) wns(level) = wn words(level) = word C WRITE(*,*) 'Level=',level,', Key="',word(1:wn),'"' IF ( level.LT.prev_level ) THEN IF ( qpre ) THEN WRITE (10+prev_level,121) '