Google
 

Trailing-Edge - PDP-10 Archives - BB-D875A-SM - dx/sources/txtwp8.for
There is 1 other file named txtwp8.for in the archive. Click here to see a list.
C	       PACKAGE	       :       DX/TOPS20
C	       VERSION         :       V1.0
C	       OP. SYSTEM      :       TOPS20 V3.0
C
C              PROGRAM         :       WFLX
C	       MODULE          :       TXTWP8.FOR
C	       MODULE #        :       12 OF 17
C	       EDIT            :       005
C	       EDIT DATE       :       18-AUGUST-78
C
C
C
C**********************************************************************
C
C	       C O P Y R I G H T
C
C
C	COPYRIGHT (C) 1978
C       DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS
C
C
C       THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY  ON  A
C       SINGLE  COMPUTER  SYSTEM  AND  MAY  BE  COPIED  ONLY  WITH THE
C       INCLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR
C       ANY  OTHER  COPIES  THEREOF,  MAY NOT BE PROVIDED OR OTHERWISE
C       MADE AVAILABLE TO ANY OTHER PERSON  EXCEPT  FOR  USE  ON  SUCH
C       SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE TERMS.  TITLE TO
C       AND OWNERSHIP OF THE SOFTWARE SHALL AT  ALL  TIMES  REMAIN  IN
C       DIGITAL.
C  
C       THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
C       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
C       EQUIPMENT CORPORATION.
C  
C       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY
C       OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
C  
C**********************************************************************
C
C
C	E D I T   H I S T O R Y
C
C
C  EDIT #000	5/4/78		GARTH REID
C	INITIAL IMPLEMENTATION.
C
C  EDIT #001	5/8/78		J. COHEN
C	INITIAL CHANGES FOR TOPS20.
C
C  EDIT #002	5/31/78		J. COHEN
C	WHEN READING HEADER INFORMATION, READ IT INTO TTYIN, NOT HEADER,
C	SINCE THIS INFORMATION IS NOT NEEDED.
C
C  EDIT #003	7/18/78		J. COHEN
C	ALTER METHOD USED TO COMPUTE THE BLOCK COUNT.
C
C  EDIT #004	8/12/78		G. A. REID
C	CHANGE DOCUMENT FILES FROM SEQUENTIAL TO DIRECT ACCESS.
C
C  EDIT #005	8/18/78		J. COHEN
C	ALLOW FOR EXTERNAL RULER SETTING H TO BE MAPPED TO INTERNAL
C	RULER SETTING L FOR HYPHENATION ZONE.
C
C********************************************************************
C
C
C
	SUBROUTINE TXTWP8
	INCLUDE 'SPCFLX.FTN'
C
C
C  T X T W P 8 . F T N
C
C
C  TXTWP8 (TeXT to WP8) is the module that produces Word Processing
C  files from the various forms of text files.
C
C
C  NEED TO CLOSE THE INPUT FILE AND REOPEN IT SINCE WP8FLX
C  HAS ALREADY READ THE FIRST LINE OF THE FILE TO SEE IT IT'S
C  A WORD PROCESSING FILE.  THIS AVOIDS LOSING THE FIRST LINE.
C
C
	CLOSE (UNIT=1)
C
C  IF INPUT FILE IS A WORD PROCESSING FILE, OPEN AS RANDOM,
C  OTHERWISE OPEN AS SEQUENTIAL.
C
	IF (INFILV .NE. 0) GO TO 3
	OPEN (UNIT=1,DEVICE='DSK:',FILE=NAMIN,ACCESS='RANDIN',
	1     RECORDSIZE=67,ERR=1,DISPOSE='SAVE',MODE='ASCII',
	2     ASSOCIATEVARIABLE=IAVI)
	GO TO 2
3	OPEN (UNIT=1,FILE=NAMIN,DEVICE='DSK:',ACCESS='SEQIN',
	1     MODE='ASCII',ERR=1,DISPOSE='SAVE')
	GO TO 2
C
C  SHOULD NEVER GET HERE!
C
1	STOP 676
C
C
C  Check FILMOD to see how the output file is to be modified.
C  Where:
C	1 = overwrite, 2 = add to TOP, 3 = add to BOTTOM and
C	4 = new file
C
2	GO TO (20,25,30,20), FILMOD
C
C  Should never get here!
C
	STOP 577
C
C
C  The output file is either a NEW file or should OVERWRITE an existing
C  file.
C  Also, set EOD to indicate to WP8OUT that we want the last record
C  written to LUN 3 to be an End-of-Document packet.
C
20	EOD = .TRUE.
	GO TO 40
C
C  The output file needs to be added to the TOP of an existing file.
C  Set EOD to tell WP8OUT that we want the last record written
C  to LUN 3 to be a Text-of-Document packet.
C
25	EOD = .FALSE.
	CLOSE(UNIT=2)
C
C  NEED TO OPEN 'OLD' VERSION AND THEN 'NEW' SO THAT THE 
C  'OLD' VERSION CAN BE READ DURING WRAPUP.
C
	OPEN(UNIT=3,FILE=NAMOUT,ACCESS='RANDIN',
	1  RECORDSIZE=67,ERR=2099,DISPOSE='SAVE',
	2  ASSOCIATEVARIABLE=IAVI3,DEVICE='DSK:',MODE='ASCII')
C
C
	OPEN(UNIT=2,ACCESS='RANDOM',
	1  RECORDSIZE=67,ERR=2098,DISPOSE='SAVE',
	2  ASSOCIATEVARIABLE=IAVO,DEVICE='DSK:',MODE='ASCII')
	GO TO 40
C
C  SHOULD NEVER GET HERE.
C
2098	STOP 2011
2099	STOP 2012
C
C  The output file needs to be added to the BOTTOM of an existing file.
C  Set EOD to make the last record written by WP8OUT be an
C   End-of-Document packet.
C
30	EOD = .TRUE.
C
C
C  B E G I N   P R O C E S S I N G
C
C
40	SPCNOW = 0
	TOTCNT = 0
	BLKCNT = 0
	OUTCNT = 1
	RECCNT = 0
	SFTSTE = 0
C
C  Initialize the output associated variable to either skip the header
C  of a new file or to skip the existing records in an old file.
C
	IAVO = 3
	IF (FILMOD .EQ. 3) IAVO = OLDMAX + 1
	IF (INFILV .NE. 0) GO TO 45
C
C  Both files are Word Processing Files.  This means the operation
C  is a copy or a copy with append.  Perform the copy here and on
C  end-of-file on input, go to the usual wrap-up code.
C
	IAVI = 3
41	READ(1'IAVI,42,END=201) INCNT,INBUF
42	FORMAT(I2,158R1)
	DO 421 I = 2,INCNT
	OUTCHR = INBUF(I)
	CALL WP8OUT
421	CONTINUE
	GO TO 41
C
C  P U T   O U T   S T A R T   O F   R U L E R
C
C
C  A ruler starts with stroke N (|N) an