.;GENDOC.CMD
.;
.; COMMAND FILE TO HELP MAKE DOCUMENTS
.;
	.ENABLE SUBSTITUTION
	.ENABLE GLOBAL
	.ENABLE ESCAPE
.START:	.SETF $TEST
	.SETF $IDEA
	.SETF $OVERV
	.SETS M1 "MAC REPLACEMENT PROJECT"
	.SETS M2 "PARATRONICS UPGRADE PROJECT"
	.SETS M3 "MEMO"
	.SETS M4 "SWIC SCANNER PROJECT"
	.XQT TEC @[17,377]DATTIM
	.GOTO A1
.A1A:
	;THIS COMMAND WILL GENERATE DOCUMENTS FOR THE FOLLOWING
	;PROJECTS
	;
	; 1) 'M1'
	; 2) 'M2'
	; 3) 'M3'
	; 4) 'M4'
	;
.A1:
	.SETN MAX 4.
	.ASKN [::0.] Z WHAT PROJECT
	.IFT <ESCAPE> .GOTO A1A
	.IF Z = 0 .GOTO A1A
	.IF Z > MAX .GOTO A1A
	.SETS TMP "M'Z'"
	.SETS $PROJ 'TMP'
	.SETN $TRCF 'Z'.
	.IF Z = 3 .SETN TYPDOC 3
	.IF Z = 3 .GOTO 2
	.GOTO 1A
.1:
; FOR TEST, USE DOC TYPE 0
;
; DOCUMENTS HAVE THE FOLLOWING TYPES
;
;	1) DESIGN SPEC
;	2) TECHNICAL NOTE
;	3) MEMO (NO DOCUMENT NUMBER OR TRACE)
;	4) IDEA - DESIGN SPEC W/O DETAILED PLAN & NOT NESSASARLY THOUGHT OUT
;	5) CHANGE SPEC
.IF $TRCF NE 1. ;	6) OVERVIEW
;
;
.1A:
	.ASKN [::0.] TYPDOC WHAT TYPE DOCUMENT DO YOU WANT
	.IFT <ESCAPE> .GOTO 1
	.IF TYPDOC > 0 .GOTO 2
	.SETT $TEST
	; ENTER TEST MODE, DOCUMENT WILL NOT BE MADE
	;
	.GOTO 1A
.2:	.SETN MAX 5
	.IF $TRCF NE 1 .SETN MAX 6.
	.IF TYPDOC = 4 .SETT $IDEA
	.IF TYPDOC = 4 .SETN TYPDOC 1
	.IF TYPDOC = 1 .GOTO DESSPE
	.IF TYPDOC = 2 .GOTO TECSPE
	.IF TYPDOC = 3 .GOTO MEMOS
	.IF TYPDOC = 4 .GOTO ERR1
	.IF $TRCF NE 1 .IF TYPDOC = 6 .SETT $OVERV
	.IF $TRCF NE 1 .IF TYPDOC = 6 .GOTO DESSPE
	.IF TYPDOC > MAX .GOTO ERR1
	.GOTO ERR1

.DESSPE:
.;
.; DESIGN SPEC
.;
	@[17,377]DSASK
	.GOSUB DOCNUM
	@[17,377]DSGEN
	.GOTO END
.TECSPE:
.;
.; TECHNECAL NOTE
.;
	@[17,377]DSASK
	.GOSUB DOCNUM
	@[17,377]TECGEN
	.GOTO END
.MEMOS:
	@[17,377]MEMASK
	.WAIT TEC
	@[17,377]DATTIM
	@[17,377]MEMGEN
	.GOTO END1
.ERR1:
.;
.;SPECIFIED TYPE OF DOCUMENT IS NOT SUPPORTED
.;
;SPECIFIED DOCUMENT TYPE IS NOT SUPPORTED
	.GOTO	1
.;
.END:
	.IFT $TEST .GOTO END1
	.OPEN #0 [17,377] DOC'$TRCF'.TMP
.ENABLE DATA #0
*****
****
***
**
*

DOCUMENT NUMBER = '$DOCN'
FILE = '<UIC>''$FILE'.RNO
TITLE = '$TITLE'
DATE = '$DATE' '$TIME'
AUTHOR = '$BY'
GROUP ='$GRUP'
SUBJECT = '$SUB'

*
**
***
****
.DISABLE DATA #0
	.CLOSE	#0
	PIP [17,377]DOCS'$TRCF'.TRC/AP=[17,377]DOC'$TRCF'.TMP
	PIP [17,377]DOC'$TRCF'.TMP;*/DE
.END1:
;
; EDIT FILE '<UIC>''$FILE'.RNO
;
/
.DOCNUM:
	@[17,377]GROUP
	.ASK ZZ DO YOU WANT TO DO IT OVER
	.IFT ZZ .GOTO REDO
	.IFF $TEST @[17,377]DOCNUM'$TRCF'
	.IFT $TEST .SETN $DOCN 0
	.WAIT TEC
	@[17,377]DATTIM
	.RETURN
.REDO:
	.GOTO START
