.; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.;
.;	Execute.cmd,  a command file to compile, link
.;		with libraries with a simple user 
.;		interface 
.;
.;	entry by typing:
.;
.;	ask questions  --	>exe    (mcr)	>.exe    (dcl)
.;	help message   --	>exe ?		>.exe ?
.;	no questions   --	>exe file,p1,p2...  >.exe file,p1,p2..
.;
.;
.;
.; Author:	Edward J. Cetron
.;		Center for Biomedical Design
.;		3168 MEB, Univ. of Utah
.;		Salt Lake City, Utah   84112
.;		(801)-581-6499
.;
.;
.ENABLE SUBSTITUTION
.ENABLE CONTROL-Z
.setf dcl
;.ONERR 6969
.enable quiet
.if <cli> eq "DCL" .sett dcl
.IF <CLI> EQ "MCR" .GOTO 1
.DISABLE QUIET
; Exiting without waiting to be asked could leave you in MCR
.ENABLE QUIET
set /mcr=ti:
.1:
.TESTFILE FX:[1,1]LABDEVLIB.OLB
.IF <FILERR> EQ 1 .SETS LIB "FX:[1,1]LABDEVLIB/LB"
.IF <FILERR> <> 1 .SETS LIB "LB:[1,1]labdevlib/lb"
.SETS ANY "NOTHING"
.SETS PLT ""
.SETS LSPLIB ""
.SETS MP ""
.sets usrlib ""
.sets vslib ""
.sets vsdsk "lb:"
.sets vssiz ""
.setf vsfont
.setf vsfile
.setf pace
.setf ovrly
.setf clstr
.setf ad
.setf tek
.setf meg
.setf vs11
.setf clk
.setf ssp
.setf vsp
.setf lsp
.setf rms
.setf idspc
.setf acpres
.setf clstr
.setf ovrly
.setf dbg
.setf cussup
.setf spec
.setf pri
.setf map
.setf lst
.sett wat
.setf help
.setf askqst
.sett ftn
.sets calls comman
.parse calls " ," dummy file a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20
; '<strlen>' 'dummy' 'file' 'a1'
.enable quiet
.if <strlen> eq 1 .goto 7843
.if <strlen> eq 2 .goto 432
.DISABLE QUIET
; SET-UP, please stand-by....
.enable quiet
.setn count <strlen>-2.
.55564:
.if count eq 0 .goto 432
.gosub eval a'count'
.setn count count-1.
.goto 55564
.432:
.GOSUB EVAL FILE
.iff help .goto nohlp
.HLPP:
.disable quiet 
;	SYNTAX:      ].exe file,sw1,sw2,......,sw19  
;
;    control switches:
;	MAP - create map    LST or LIST - create list   ASK - ask all questions
;	NWT - skip exit questions	NFTN - do not recompile (F77)
;
;    lab subroutine and library switches:
;	AD  - using A/D or D/A calls	HP, PLOTTER, or TEK - using plot calls
;	MEG - using MEGETEK device	VSnK - using VS11 with nK display file
;	VSFONT - advanced VS11 calls	VSFILE - saving/loading display files
;	VSALL - both VSFONT & VSFILE	LSP, SSP, or VSSP - use specified lib.
;	CLK, CLOCK, KW11P or PACE - use clock calls, PACE also inclludhas priv'ed code
;	AST or CUSTOM or VIRTUAL - using custom virtual array or AST support
;	USER or USERLIB - user library linkage is required
;
;    task parameter switches:
;	ID  - use I-space and D-space for additional space
;	RMS - use the RMS file system (default is FCS)
;	RES or RESIDENT - use RMSRES or FCSFSL as appropriate
;	CLSTR or CLUSTER - cluster RMSRES,F4PRES or F4PRES/FCSFSL
;	OVRLY or OVERLAY - overlay the plotter and VS11 libraries
;	PRI OR PRIORITY - priority program is desired
;
.enable quiet
.disable display
.GOTO 6969
.NOHLP:
.ift askqst .goto 7844
.disable quiet 
;
;
; Using command string to compile 'file'.FTN
;
.sets clls "  Generate: "
.ift lst .sets clls clls+"  lists"
.ift map .sets clls clls+"  maps"
.ift pri .sets clls clls+"  priority task image"
.ift ovrly .sets clls clls+"  overlaid plot/vs11 libraries"
;'clls'
.sets clls "  Device calls to: "
.iff clk .and .iff meg .and .iff ad .and .iff tek .goto 10
.ift tek .sets clls clls+"Plotter   "
.ift ad .sets clls clls+"Analog I/O   "
.ift meg .sets clls clls+"Megetek  "
.ift clk .sets clls clls+"KW11P clock"
.ift pace .sets clls clls+" with PACEing"
;
;'clls'
.10:
.iff vs11 .goto 102
.sets clls "  VS-11 library with: "
.sets clls clls+" Display file of "+vssiz
.ift vsfile .sets clls clls+"  VSFILE  VSLOAD"
.ift vsfont .sets clls clls+"  VSFONT  VSPOLY ..."
;
;'clls'
.102:
.iff ssp .and .iff vsp .and .iff lsp .and .iff cussup .and .iff spec .goto 210
.sets clls "  Routine calls to: "
.ift ssp .sets clls clls+"  SSP library"
.ift vsp .sets clls clls+"  VSP library"
.ift lsp .sets clls clls+"  LSP library"
.ift cussup .sets clls clls+"  LABDEVLIB library"
.ift spec .sets clls clls+"  user library"
;
;'clls'
.210:
.sets clls "  Use FCS file system"
.ift rms .sets clls "  Use RMS file system"
.ift acpres .and .iff clstr .sets clls clls+", and resident file system library"
.ift clstr .and .ift rms .sets clls clls+", and cluster library of RMS and F77 OTS"
.ift clstr .and .iff rms .sets clls clls+", and using F4PRES linked to FCSFSL (F4PFSL)"
;
;'clls'
.sets clls " Use the I- and D-space facilities of M-Plus"
.iff idspc .goto 23432
;'clls'
.goto 23432
.7843:
.ASKS FILE Filename
.7844:
.IF FILE EQ "?" .GOTO HLPP
.SETF COMMON
.ASK AD A/D or D/A calls
.ASK TEK Tektronix or HP calls
.ASK MEG Megatek calls
.ask vs11 VS-11 calls 
.iff vs11 .goto 453
.asks vssiz What size display file [1,2,3,4,5,6,8,10,15]
.SETS VSSIZ VSSIZ+"K"
.disable quiet
; Will you be using multiple fonts
.enable quiet
.ask      vsfont or features such as VSCURV, VSPOLY or VSDTHK
.ask vsfile Will you be using VSFILE or VSLOAD
.453:
.ASK CLK KW11P clock calls
.ift clk .ask Pace Will you be pacing
.ASK SSP SSP library
.ASK VSP VSSP library
.ASK LSP LSP library
.ask rms Use RMS-11 file system (relative and indexed files)
.ask acpres Use resident library to save space
.ift acpres .and .ift rms .ask clstr Use the cluster library for F77 and RMS
.ift acpres .and .iff rms .ask clstr Use the F4PRES linked with FCSFSL (F4PFSL)
.ift vs11 .or .ift tek .ask ovrly Overlay VSLIB, PLTLIB and HPLIB
.ask cussup Do you need any custom virtual array or AST support
.ASK SPEC Do You Need Any User Libraries
;	Answer yes to the following question only if priority
;		is absolutely critical.  
.ask pri Is this a priority program
.ASK MAP Map desired
.ASK LST Lists desired
.disable quiet
.23432:
.SETS VSDSK "LB:"
.iff vs11 .goto skip
.IF VSSIZ NE "" .GOTO SKIP
.asks vssiz What size display file [1,2,3,4,5,6,8,10,15]
.SETS VSSIZ VSSIZ+"K"
.SKIP:
.IF VSSIZ EQ "8K" .SETS VSDSK "DL1:"
.IF VSSIZ EQ "10K" .SETS VSDSK "DL1:"
.IF VSSIZ EQ "15K" .SETS VSDSK "DL1:"
.IFT SPEC .ASKS USRLIB What Is The Name Of Your Library
;
;
; *******************************************
;
;	Ready to compile...
;
; *******************************************
;
;
.enable quiet
.ift cussup .or .ift ad .or .ift clk .sets any lib
.iff ftn .goto 4312
.setf lev
.ift wat .ASK LEV Do you wish to exit
.ift lev .goto 6969
.sets colin "co:50"
.disable quiet
.IFF LST F77 'FILE'='FILE'/'colin'
.IFT LST F77 'FILE'/tr:all,'FILE'='FILE'/'colin'
.enable quiet
.4312:
.IFT MAP .SETS MP ",'FILE'/-SP"
.iff map .sets mp ""
.sets prtsk ""
.ift pace .sets prtsk "/pr:0"
.ift vs11 .sets prtsk prtsk+"/-xh"
.iff dbg .OPEN 'FILE'.tkb
.ift dbg .open ti:
.ift ovrly .goto 5567
.iff idspc .DATA 'FILE'/fp/-AL/CP'prtsk''MP'='FILE'
.ift idspc .data 'file'/fp/id/-al/cp'prtsk''mp'='file'
.iff meg .and .ift tek .data lb:[1,1]megfak.obj
.iff vs11 .and .ift tek .data lb:[1,1]vsfak.obj
.ift vs11 .data 'VSDSK'[1,1]vsdf'vssiz'.obj
.ift vs11 .data lb:[1,1]vsblock.obj
.IFT SPEC .DATA 'USRLIB'
.IF ANY NE "NOTHING" .DATA 'ANY'
.SETS XX "LB"
.TESTFILE FX:[1,1]PLTLIB.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.ift tek .or .ift meg .data 'XX':[1,1]pltlib/lb
.SETS XX "LB"
.TESTFILE FX:[1,1]HPLIB.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.ift meg .or .ift tek .data 'XX':[1,1]hplib/lb
.ift vs11 .data lb:[1,1]vslib/lb
.IFT SSP .DATA LB:[1,1]SSPLIB/LB
.IFT VSP .DATA LB:[1,1]VSSPLIB/LB
.IFT LSP .DATA LB:[1,1]LSPLIB/LB
.ift clk .data lb:[1,1]exelib/lb,lb:[1,54]rsx11m.stb/ss
.SETS XX "LB"
.TESTFILE FX:[1,1]F4PRMS.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.ift rms .data 'XX':[1,1]f4prms/lb
.SETS XX "LB"
.TESTFILE FX:[1,1]RMSLIB.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.ift rms .and .ift acpres .data 'XX':[1,1]rmslib/lb:r0autl:r0impa:rmssym:r0exsy
.SETS XX "LB"
.TESTFILE FX:[1,1]RMSLIB.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.ift rms .data 'XX':[1,1]rmslib/lb
.SETS XX "LB"
.TESTFILE FX:[1,1]F4PFCS.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.iff rms .data 'XX':[1,1]f4pfcs/lb
.SETS XX "LB"
.TESTFILE FX:[1,1]SYSLIB.OLB
.IF <FILERR> EQ 1 .SETS XX "FX"
.DATA 'XX':[1,1]SYSLIB.OLB/DL
.DATA /
.iff acpres .goto 39
.ift rms .and .iff clstr .data reslib=lb:[1,1]rmsres/ro
.iff rms .and .iff clstr .data reslib=lb:[1,1]fcsres/ro
.ift rms .and .ift clstr .data clstr=f4pcls,rmsres:ro
.iff rms .and .ift clstr .data libr=f4pfsl:ro
.39:
.ift clk .or .ift ad .or .ift meg .data common=labcom:rw
.ift pri .data Pri=80
.ift vsfont .or .ift vsfile .data units=8
.ift vsfont .data maxbuf=756
.ift vsfont .or .ift vsfile .data actfil=4
.DATA //
.CLOSE
.goto 20
.5567:
.iff idspc .DATA 'FILE'/fp/-AL/CP'prtsk''MP'='FILE'/mp
.ift idspc .DATA 'FILE'/id/fp/-AL/CP'prtsk''MP'='FILE'/mp
.iff acpres .goto 399
.ift rms .and .iff clstr .data reslib=lb:[1,1]rmsres/ro
.iff rms .and .iff clstr .data reslib=lb:[1,1]fcsres/ro
.ift rms .and .ift clstr .data clstr=f4pcls,rmsres:ro
.iff rms .and .ift clstr .data libr=f4pfsl:ro
.399:
.ift clk .or .ift ad .or .ift meg .data common=labcom:rw
.ift pri .data Pri=80
.ift vsfont .or .ift vsfile .data units=8
.ift vsfont .data maxbuf=756
.ift vsfont .or .ift vsfile .data actfil=4
.DATA //
.close
.iff dbg .open 'file'.odl
.ift dbg .open ti:
.iff vs11 .sets cotree ""
.ift vs11 .sets cotree ",vscotr"
.iff vsfont .sets adv ""
.ift vsfont .sets adv ",vsadv"
.data	.root	'file'-ovrhd-lib-labrot'cotree''adv'
.sets mgfk "lb:[1,1]syslib/lb:null"
.sets vsfk ""
.iff meg .and .ift tek .sets mgfk "lb:[1,1]megfak.obj"
.iff vs11 .and .ift tek .sets vsfk "lb:[1,1]vsfak.obj"
.ift vs11 .sets vsfk VSDSK+"[1,1]vsdf"+vssiz+".obj"
.iff tek .and .iff vs11 .data ovrhd:	.fctr	lb:[1,1]syslib/lb:null
.ift tek .or .ift vs11 .data ovrhd:	.fctr	'mgfk'-'vsfk'
.data	.name	root
.sets libs "root"
.IFT SPEC .sets libs libs+"-"+USRLIB
.IF ANY NE "NOTHING" .sets libs libs+"-"+any
.sets libs libs+"-lb:[1,1]pltlib/lb"
.IFT SSP .sets libs libs+"-LB:[1,1]SSPLIB/LB"
.IFT VSP .sets libs libs+"-LB:[1,1]VSSPLIB/LB"
.IFT LSP .sets libs libs+"-LB:[1,1]LSPLIB/LB"
.ift clk .sets libs libs+"-lb:[1,1]exelib/lb-lb:[1,54]rsx11m.stb/ss"
.ift rms .and .iff acpres .sets libs libs+"-lb:[1,1]f4prms/lb-lb:[1,1]rmslib/lb"
.ift rms .and .ift acpres .sets libs libs+"-lb:[1,1]f4prms/lb-rmsrot-lb:[1,1]rmslib/lb"
.iff rms .sets libs libs+"-lb:[1,1]f4pfcs/lb"
.data lib:	.fctr	'libs'
.ift rms .and .ift acpres .data @lb:[1,1]rmsrlx
.ift rms .and .iff vs11 .data @lb:[1,1]lablibrms.odl
.iff rms .and .iff vs11 .data @lb:[1,1]lablibfcs.odl
.ift rms .and .ift vs11 .and .iff vsfont .data @lb:[1,1]labrmsvs.odl
.iff rms .and .ift vs11 .and .iff vsfont .data @lb:[1,1]labfcsvs.odl
.ift rms .and .ift vsfont .data @lb:[1,1]labrmsfnt.odl
.iff rms .and .ift vsfont .data @lb:[1,1]labfcsfnt.odl
.data	.end
.close
.20:
.disable quiet
;
;
; *******************************************
;
;	Ready to task build....
;
; *******************************************
;
;
.setf lev
.ift wat .ASK LEV Do you wish to exit
.ift lev .goto 6969
tkb @'FILE'.tkb
pur 'FILE'.*
.goto 6969
.eval:
.sets temp 'comman'
.if temp eq "NWT" .setf wat
.if temp eq "NFTN" .setf ftn
.if temp eq "AD" .sett ad
.if temp eq "PLOTTER" .SETT TEK
.IF TEMP EQ "TEK" .SETT TEK
.IF TEMP EQ "HP" .SETT TEK
.IF TEMP EQ "MEG" .SETT MEG
.SETS DUM TEMP[1:2]
.IF DUM EQ "VS" .SETT VS11
.SETS DUM TEMP[4:4]
.IF DUM EQ "K" .SETS VSSIZ TEMP[3:*]
.IF TEMP EQ "VSALL" .SETT VSFONT
.IF TEMP EQ "VSALL" .SETT VSFILE
.IF TEMP EQ "VSFONT" .SETT VSFONT
.IF TEMP EQ "VSFILE" .SETT VSFILE
.IF TEMP EQ "CLK" .SETT CLK
.IF TEMP EQ "CLOCK" .SETT CLK
.IF TEMP EQ "KW11P" .SETT CLK
.IF TEMP EQ "PACE" .SETT PACE
.IF TEMP EQ "PACE" .SETT CLK
.IF TEMP EQ "SSP" .SETT SSP
.IF TEMP EQ "LSP" .SETT LSP
.IF TEMP EQ "VSSP" .SETT VSP
.IF TEMP EQ "RMS" .SETT RMS
.IF TEMP EQ "RES" .SETT ACPRES
.IF TEMP EQ "RESIDENT" .SETT ACPRES
.IF TEMP EQ "CLUSTER" .SETT CLSTR
.IF TEMP EQ "CLUSTER" .SETT ACPRES
.IF TEMP EQ "CLSTR" .SETT CLSTR
.IF TEMP EQ "CLSTR" .SETT ACPRES
.IF TEMP EQ "OVRLY" .SETT OVRLY
.IF TEMP EQ "OVERLAY" .SETT OVRLY
.IF TEMP EQ "AST" .SETT CUSSUP
.IF TEMP EQ "VIRTUAL" .SETT CUSSUP
.IF TEMP EQ "CUSTOM" .SETT CUSSUP
.IF TEMP EQ "USER" .SETT SPEC
.IF TEMP EQ "USERLIB" .SETT SPEC
.IF TEMP EQ "PRI" .SETT PRI
.IF TEMP EQ "PRIORITY" .SETT PRI
.IF TEMP EQ "MAP" .SETT MAP
.IF TEMP EQ "LIST" .SETT LST
.IF TEMP EQ "LST" .SETT LST
.if temp eq "?" .sett help
.if temp eq "ASK" .SETT ASKQST
.if temp eq "ID" .sett idspc
.if temp eq "IDSPC" .sett idspc
.if temp eq "DBG" .sett dbg
.return
.6969:
.ift dcl set /dcl=ti:

