	.ENABLE SUBSTITUTION
	.DISABLE LOWERCASE
	.DISABLE QUIET
	.ENABLE ESCAPE
	.;
	.; Set the next variable to the program name.
	.;
	.; PNAME = the program name used for the name of the library
	.;		and the output file names at task build time.
	.;
	.; TNAME = the name used for the task build command file.
	.;
	.SETS PNAME "VTL"
	.SETS TNAME "'PNAME'"
	.TEST PNAME
	.IF <STRLEN> > 6 .SETS TNAME PNAME[1:6]
	.SETS TNAME "'TNAME'BLD.CMD"
	.SETN EXSTAT 1.
	.;
	.; Inputs:
	.;	P1 = either TKB to go directly to taskbuilding.
	.;	     or /DA to taskbuild with DDT when MAC finished.
	.;	P2 = if TKB specified in P1, /DA can be specified
	.;	     in P2 to taskbuild with DDT.
	.;
	.IF P1 = "TKB" .GOTO TKB1
	;
	; Command file to assemble and/or taskbuild the 'PNAME' program.
	;
	.TESTFILE 'PNAME'.OLB
	.IF <FILERR> = 1 .GOTO GLIST
	; Creating library file "'PNAME'.OLB" ...
	;
	.ENABLE QUIET
	LBR 'PNAME'.OLB/CR
	.;
	.; See if the user wants macro listings.
	.;
.GLIST:	.ASKS MLIST Do you want macro listings (Yes)
	.SETT LFLAG			! Presume true.
	.IF MLIST = "" .GOTO GETMOD
	.SETS MLIST MLIST[1:1]
	.IF MLIST <> "Y" .SETF LFLAG
	.;
	.; Get the module name to assemble.
	.;
.GETMOD:
	.DISABLE QUIET
	.ENABLE ESCAPE
	.ASKS MODULE Enter module name to assemble
	.IFT <ESCAPE> .GOTO HELP
	.DISABLE ESCAPE
	.PARSE MODULE "." MODULE EXT
	.IF MODULE = "" .GOTO TKB
	.;
	.; See if the module specified exists.
	.;
	.TESTFILE 'MODULE'.MAC
	.IF <FILERR> = 1 .GOTO ASM
	;
	; Unable to access module "'MODULE'.MAC", please try again.
	;	The FCS error code is '<FILERR>'.
	;
	.GOTO GETMOD
.HELP:
	;
	; Type the RETURN key to start taskbuilding, or CTRL/Z to exit.
	;
	.GOTO GETMOD
.ASM:
	.SETS LDEV ""
	.IFT LFLAG .SETS LDEV ",'MODULE'/-SP"
	.;
	.; Assemble the specified module, exit on any error.
	.;
	MAC 'MODULE''LDEV'=VTLPRE/PA:1,'MODULE'
	.SETN EXSTAT <EXSTAT>
	.IF EXSTAT <> 1 PIP 'MODULE'.OBJ;0/DE
	.IF EXSTAT <> 1 .EXIT <EXSTAT>
	.;
	.; Replace object module in the library.
	.;
	LBR 'PNAME'/RP='MODULE'
	.ENABLE QUIET
	PIP 'MODULE'.OBJ;0/DE
	.IFT LFLAG PIP 'MODULE'.LST/PU
	.IFT LFLAG PIP 'MODULE'.LST/TR
	.GOTO GETMOD
.TKB:	.DISABLE ESCAPE
	.;
	.; See if taskbuilding is desired.
	.;
	.IF P1 = "/DA" .GOTO TKB1
	.ASKS WTKB Do you want to taskbuild 'PNAME' (Yes)
	.IF WTKB = "" .GOTO T2
	.SETS WTKB WTKB[1:1]
	.IF WTKB <> "Y" .EXIT
.T2:	.;
	.; See if taskbuilding with DDT is desired.
	.;
	.ASK Z Do you want to taskbuild with DDT
	.IFT Z .SETS P1 "/DA"
.TKB1:	.DISABLE QUIET
	.;
	.; Set up the strings for taskbuilding with DDT.
	.;
	.IF P1 = "TKB" .SETS P1 "'P2'"
	.IF P1 <> "/DA" .SETS P1 ""
	.TESTFILE LB:[1,1]FCSRES.STB
	.IF <FILERR> = 1 .GOTO T5
	;
	; File "LB:[1,1]FCSRES.STB" was not found, exiting ...
	;
	.EXIT
.T5:	.TESTFILE 'PNAME'.OLB
	.IF <FILERR> = 1 .GOTO T10
	;
	; The library file "'PNAME'.OLB" was not found, exiting ...
	;
	.EXIT
.T10:	.SETF DEBFLG
	.SETS DEBUG ""
	.SETS STB ""
	.IF P1 <> "/DA" .GOTO T20
	.SETT DEBFLG
.;	.SETS DEBUG ",LB:[1,1]DDT/DA"
	.SETS DEBUG ",sy:[263,70]DDT/DA"
	.SETS STB ",'PNAME'"
.T20:	.SETS NAM PNAME[1:3]
	.;
	.; Put your taskbuild command file here (usually specific).
	.;
	.OPEN #1 'TNAME'
	.ENABLE DATA #1
;
;	Command file to task build the 'PNAME' program.
;
'PNAME'/CP/-FP,'PNAME'/CR/-SP'STB'=
'PNAME'/LB:VTL:VTLACT:VTLBUF:VTLCMD:VTLERR:VTLFCS:VTLFDB
'PNAME'/LB:VTLFMT:VTLFND:VTLHDR:VTLIO:VTLKEY:VTLNAM:VTLOPE
'PNAME'/LB:VTLPAD:VTLPAR:VTLPOS:VTLRUL:VTLSCR:VTLSET:VTLSHO
'PNAME'/LB:VTLSPN:VTLSUB:VTLTBL:VTLTWO:VTLUTL:VTLWRT
'PNAME'/LB:PARSE:RSXMSG:.tpars:ascr50:parsfn'DEBUG'
/
UNITS=8
ASG=SY:1:2:3:7
ASG=TI:4:5:6
TASK=...'NAM'
;
;	The switch mask defines the default VTL switches.  If you don't
;	have the advanced video option, bit B.AVO should be disabled.
;
;	Switch definitions:
;
;	B.NAR	=	1		; List file on narrow screen.
;	B.WIDE	=	2		; List file on wide screen.
;	B.BELL	=	4		; Ring the bell on messages.
;	B.FE	=	10		; Force user to exit at EOF.
;	B.FF	=	20		; Pass form feeds to terminal.
;	B.AVO	=	40		; VT100 with advanced video.
;	B.HDR	=	100		; Display the file header.
;	B.WAIT	=	200		; Wait for user after errors.
;	B.GBL	=	400		; Do global search (not implemented).
;	B.XACT	=	1000		; Do exact search (0 = general).
;	B.PROT	=	2000		; Protect file on deletion.
;	B.SCRB	=	4000		; Scroll both files in split screen.
;
;	The default switch mask:
;
;	002210 = B.PROT!B.WAIT!B.FE
;
GBLPAT=VTL:SWMASK:002210
.DISABLE DATA #1
.;	.IFF DEBFLG .DATA #1 LIBR=FCSRES:RO
	.DATA #1 //
	.CLOSE #1
	PIP 'PNAME'.TSK;*/DE/NM,'PNAME'.MAP;*,'PNAME'.STB;*
	TKB @'TNAME'
	.ENABLE QUIET
	.WAIT CRF...
	PIP 'TNAME';0/DE
.;	PIP 'PNAME'.TSK/PU/NM,'PNAME'.MAP,'PNAME'.STB
	PIP 'PNAME'.MAP/TR
	.IFF <PRIVIL> .GOTO DONE
	.DISABLE QUIET
	.SETF DOINS
	.IFINS ...'NAM' .SETT DOINS
	.IFT DOINS REM ...'NAM'
	.IFT DOINS INS 'PNAME'
.DONE:	.DISABLE QUIET
	; Wake up, taskbuild is finished ...
