Google
 

Trailing-Edge - PDP-10 Archives - -
There are no other files named in the archive.
	SUBROUTINE ENTER(IUNIT,NFILE,IEXT)
	INTEGER ANSWER
C				OPEN A FILE ON IUNIT
C				NAMED 'NFILE.IEXT'
C				WHERE NFILE, IEXT ARE ASCII VARIABLES
C				IN THE IFIL OFIL TRADITION
C				IF THE FILE ALREADY EXISTS COMMENT
1	C O N T I N U E

	IF(.NOT.LOOKUP(NFILE,IEXT)) GO TO 2
C				FILE ALREADY EXISTS
	TYPE 100, NFILE,IEXT
100	FORMAT(' FILE ',2A5,' IS ALREADY ON THE DISK'/)
5	IANS = ANSWER(' DO YOU WANT TO USE A NEW NAME?')
	IF(IANS.EQ.'NO') GO TO 10
	IF(IANS.NE.'YES') GO TO 5

	TYPE 101
101	FORMAT(' TYPE NEW FILE NAME.EXT'/)
	ACCEPT 102,NFILE,IEXT
102	FORMAT(2A5)
	GO TO 1

C				DELETE EXISTING FILE?
10	C O N T I N U E

	IF(ANSWER(' DO YOU WANT TO DELETE THE EXISTING FILE?').EQ.'YES')
	1  GO TO 2
	TYPE 103
103	FORMAT(' WHAT DO YOU WANT TO DO?????'/)
	S T O P

2	C O N T I N U E

	C A L L   O F I L (IUNIT,NFILE,IEXT)

	R E T U R N
	E N D