.; File: [22,310]MODTST.CMD     Last Edit: 17-JAN-1987 15:10:04 
.;
.ENABLE SUBSTITUTION
.IF P1 NE "" .GOTO PARMIN
;
; This command file will compile a P3UTIL module, insert it in
; LB5:[22,310]P3UTIL, extract the external declaration into EX:[22,320],
; then compile and build the test program in [22,310].  The module
; name will the parameter supplied in P1.  If there is no P1 supplied,
; this information will be displayed.  At anytime an error occurs, the
; command file will stop.  If success, purging of excess files will
; occur.
;
; This command file first looks for a PAS file, and then for a MAC file
; of the indicated source.
;
; This command file assumes that LB5: and EX: have already been assigned
; as desired.  It also assumes that the CLI is DCL.
;
.STOP
;
.PARMIN:
.;
SET DEF [22,310]
.IF <EXSTAT> NE 1 .STOP
.TESTFILE 'P1'.PAS
.IF <FILERR> EQ 1 .GOTO DOPAS
.TESTFILE 'P1'.MAC
.IF <FILERR> EQ 1 .GOTO DOMAC
;
; no such file 'P1'.PAS or 'P1'.MAC
;
.STOP
.DOPAS:
.SETS EXTEN "PAS"
PA3 'P1'/LIST
.IF <EXSTAT> NE 1 .STOP
PUR 'P1'.PAS
.GOTO DOLIB

.DOMAC:
.SETS EXTEN "MAC"
MAC PASMAC,'P1'/LIST
.IF <EXSTAT> NE 1 .STOP
PUR 'P1'.MAC
.GOTO DOLIB

.DOLIB:
DEL 'P1'.LST;*
.IF <EXSTAT> NE 1 .STOP
LBR LB5:P3UTIL/RP='P1'
.IF <EXSTAT> NE 1 .STOP
DEL 'P1'.OBJ;*
.IF <EXSTAT> NE 1 .STOP
@QUIKEXT 'P1'.'EXTEN' 'P1' EX:[22,320]
.IF <EXSTAT> NE 1 .STOP
SET DEF [22,311]
.IF <EXSTAT> NE 1 .STOP
PA3 TST'P1'/LIST
.IF <EXSTAT> NE 1 .STOP
PUR TST'P1'.PAS
.IF <EXSTAT> NE 1 .STOP
DEL TST'P1'.LST;*
.IF <EXSTAT> NE 1 .STOP
LINK @TST'P1'.TKB
.IF <EXSTAT> NE 1 .STOP
PUR TST'P1'.TSK
.IF <EXSTAT> NE 1 .STOP
DEL TST'P1'.OBJ;*,.MAP;*
.IF <EXSTAT> NE 1 .STOP
;
; done
;
