Google
 

Trailing-Edge - PDP-10 Archives - -
There are no other files named in the archive.
C	TITLE  E D I T F
C		ONLINE EDITING PROGRAM
C		EDITS ANY CATEGORY OF ANY RECORD
C		RECORD IS SPECIFIED BY ID
	DIMENSION IB(260),B(260),IPAR(10),IFRMT(3,20),NLPC(20),MNEM(20)
	DIMENSION FORMAT(6)
	COMMON IDF,LFR,NAVR,MAXR,NSPR,LSR,LFMT,NCPR,C1,C2,IFRMT
	EQUIVALENCE (IDF,IPAR),(IB,B)
	DATA NLPC/20*1/
	DATA FORMAT/'(',' ','15',' ',' ',')'/
	LOGICAL FIRST
C				UPDATE AND INTERROGATE
C				STUDENT INFORMATION FILE
C
	TYPE 1010
1010	FORMAT(' TYPE FILE NAME',' '$)
	ACCEPT 1000, IDF
1000	FORMAT(A5)
C
	C A L L   S L E C T F (IDF)
C
C		GET CATEGORY MNEMONICS
	CALL DIO(LFR-NSPR,1,IB,NSPR)
	DO 500 I=1,NCPR
500	MNEM(I)=IB(IFRMT(1,I))
	LSR = LFR-NSPR
	FIRST = .TRUE.
C
5	TYPE 1011
1011	FORMAT(' WOULD YOU LIKE TO LOOP THRU EVERYONE IN THE FILE?',' '$)
	ACCEPT 1000, IANS
C
	IF((IANS.NE.'YES').AND.(IANS.NE.'NO')) GO TO 5
C				READ AND WRITE INFO FILE
1	C O N T I N U E
C
	IF(IANS.EQ.'NO') GO TO 10
C				LOOP THRU THE FILE
	LSR = LSR + NSPR
	IF(LSR.GE.NAVR) GO TO 100
	GO TO 20
C				LOOK UP SPECIFIED ID'S
10	CONTINUE
	TYPE 1012
1012	FORMAT(' TYPE ID',' '$)
	ACCEPT 1001, IDR
1001	FORMAT(I)
C
	IF(I F I N D (IDR,1,0).NE.0) GO TO 20
	TYPE 1014
1014	FORMAT(' ERROR...ID NOT IN FILE',' '$)
	GO TO 10
C
20	CONTINUE
C
	C A L L   R E A D R (IB)
C				TYPE ID AND NAME AS A PROMPT
	TYPE 1002, (IB(I),I=1,6)
1002	FORMAT(1X,I10,1X,5A5)
C				READ CATAGORY TO BE READ OR WRITTEN
25	TYPE 1015
1015	FORMAT(' CATAGORY?',' '$)
	IF(FIRST)TYPE 1016
1016	FORMAT(' HIT THE RETURN KEY TO PROCEED TO ANOTHER RECORD'/
	1     ' TYPE 999 TO TERMINATE EDITING',' '$)
C
	ACCEPT 1001, ICAT
C
	IF(ICAT.EQ.999) GO TO 100
	IF(ICAT.GT.20) GO TO 25
	IF(ICAT.LT.1) GO TO 1
C				GET LOCATION, LENGTH AND MODE OF CATAGORY
	LOC = IFRMT(1,ICAT)
	LEN = IFRMT(2,ICAT)
	MODE= IFRMT(3,ICAT)
C				READ OR WRITE?
C	IF(FIRST) TYPE 1020
1020	FORMAT(' READ OR WRITE TYPE')
	FIRST = .FALSE.
C27	TYPE 1017
1017	FORMAT(' R OR W?',' '$)
C	ACCEPT 1000, IDO
C
C	IF((IDO.NE.'R').AND.(IDO.NE.'W')) GO TO 27
C
C				TYPE REASSURING MNEMONIC
	TYPE 1003, MNEM(ICAT)
1003	FORMAT(1X,A5,':')
	INDEX = LOC
	NWPL = LEN/NLPC(ICAT)
	FORMAT(4) = 'I'
	FORMAT(5) = ' '
	IF(MODE.EQ.1) GO TO 28
	FORMAT(4) = 'A'
	FORMAT(5) = '5'
28	CONTINUE
C	IF(IDO.NE.'R') GO TO 50
C				READ AND TYPE THE SPECIFIED CATAGORY
	FORMAT(2) = '1X,'
C
	DO 30 I=1,NLPC(ICAT)
	TYPE FORMAT, (IB(J),J=INDEX,INDEX+NWPL-1)
30	INDEX = INDEX + NWPL
C				GO BACK FOR ANOTHER CATAGORY
C				WRITE OUT A NEW CATAGORY ON DISK
50	CONTINUE
C				PRODUCE LINE FEED
	INDEX=LOC
	TYPE 2021
2021	FORMAT(' ')
C				ACCEPT INPUT FROM TTY
	FORMAT(2) = ' '
	DO 40 I=1,NLPC(ICAT)
C	TYPE 1018,I
1018	FORMAT(' TYPE LINE #',I2,' '$)
	ACCEPT FORMAT, (IB(J),J=INDEX,INDEX+NWPL-1)
40	INDEX = INDEX + NWPL
C
	C A L L   W R I T E R (IB)
C				GO BACK FOR ANOTHER CATAGORY
	G O   T O   2 5
C				A L L   D O N E
100	C O N T I N U E
	TYPE 1019
1019	FORMAT(' JOB COMPLETED'/)
	C A L L   S A V E F
	S T O P
	E N D