	.enable global
	.enable substitution
	.; install.cmd 26-Oct-84
	.; install a rms, remote rms
	.parse <uic> "," proj prog
	.parse proj "[" junk proj
	.seto prj
	.setn prj 'proj'
	.if prj < 10 .goto gotprv
	; *** warning! you must be in a priveliged uic to do these things
	.ask ok continue anyway, knowing some things will fail
	.ift ok .goto gotprv
	.exit <warnin>
.gotprv:
	.goto aftsub
.makmac:
	.; make a short macro program to use as a fortran callable RMS hook
	.; then compile the program
	.; in:
	.;     arg1 = 3-letter abbreviation of RMS routine
	.;     arg2 = $mumble name of rms macro to use
	.;     rmslb = string name of rms library - don't forget the .olb
	.;     wotlib = string purpose of library
	.parse comman " " prgabr rmsnam
	.sets prgnam "rms"+prgabr
	.sets prglng "sy:"+<uic>+prgnam+".mac"
	; creating 'prglng'
	.sets ident "/"+<date>[1:2]+<date>[4:6]+<date>[9.:9.]+"/"
	.open #0 'prglng'
	.testfile 'prglng'
	.sets actual "'<filspc>'"
	.data #1 pip 'actual'/de/nm
	.enable data #0
	.title	'prgnam' - fortran callable RMS v2.0 subroutine
	; 'actual' created by '<uic>''p0' on '<date>' '<time>'
	.ident	'ident'

	.mcall	'rmsnam'
	.psect 'prgnam',I,LCL,REL,RO
'prgnam'::
	call	$saval
	'rmsnam'
	return
	.end
.disable data #0
	.close #0
	.sets wotuse "ForTran_callable_"+rmsnam+"_routine
.;	@inmpl sy:'<uic>''prgnam' 'wotuse' 'rmslb' 'wotlib' lb:[1,1]rmsmac.mlb/ml
	@inmp sy:'<uic>''prgnam' 'wotuse' lb:[1,1]rmsmac.mlb/ml
	@inl sy:'<uic>''prgnam' 'wotuse' 'rmslb' 'wotlib'
	.return
	.;
	.;
.aftsub:
	.; here after declaring subroutines
	.; I know that DEC standards like calls down the page, but i am a simula
	.; freak (and algol-68 lover) from way back
.retry1:
	.if <cli> <> "DCL" .goto notdcl
	; 'p0' -- PROBLEM -- real programmers are alergic to DCL, which is
	; culturally compatible with COBOL
	; please use MCR, PDS or CCL etc.
	; PAUSING for you to correct this problem before I retry
	; If you REALLY like DCL you don't HAVE to kill yourself:
	; just work in an IBM shop!
	.pause
	.goto retry1
.notdcl:
	tim
	.open #1 cleanup.cmd
	.open #2 backout.cmd
	.open #3 require.
	@inmp sy:'<uic>'vsrc variable_send_request_connect lb:[1,1]rsxmac.sml/ml
	@inl vsrc variable_send_request_connect lb:[1,1]cx.olb c_extensions_for_rsx
	@inmp sy:'<uic>'vrcs variable_receive_data_or_stop lb:[1,1]rsxmac.sml/ml
	@inl vrcs variable_receive_data_or_stop lb:[1,1]cx.olb c_extensions_for_rsx
	.sets rmslb "LB:[1,1]RMS.OLB"
	.sets wotlib "in-task_RMS_subfunctions"
.;	@inmpl sy:'<uic>'gsa3 rms_memory_manager 'rmslb' 'wotlib' lb:[1,1]rmsmac.mlb/ml
	@inmp sy:'<uic>'gsa3 rms_memory_manager lb:[1,1]rmsmac.mlb/ml
	@inl sy:'<uic>'gsa3 rms_memory_manager 'rmslb' 'wotlib'
	.gosub makmac ope $open
	.gosub makmac cre $create
	.gosub makmac clo $close
	.gosub makmac con $connect
	.gosub makmac dis $disconnect
	.gosub makmac put $put
	.gosub makmac get $get
	.gosub makmac fre $free
	.gosub makmac upd $update
	.gosub makmac del $delete
	.gosub makmac dsp $display
	@inh algol68 making_C_look_like_algol(68)
	@inh rms200 defining_RMSv2.0_constants
	; you may now edit SY:'<uic>'RMS.C before compilation
	; normally the only edit is to #define or #undef "gsawatch"
	.pause
	@incl rms in_task_rms 'rmslb' 'wotlib'
	; we have now got a complete RMS library to taskbuild with
	.sets rmsat "LB:"+<libuic>+"RMSTKB.CMD"
	; pause so you can edit RMSTKB.CMD before it becomes 'rmsat'
	; most installations rewrite this COMPLETELY
	.pause
	@inc rmstst RMS_routines_demo/test_main_program
.retry2:
	@ink rmstkb taskbuild_in-task_RMS_application
	;
	; *** we will now test logic of the 'rmsat' that you made
	; *** by executing it from this command file.
	; *** secure your crash helmet! 
	;
	@rmstkb rmstst
	.if <exstat> = <succes> .goto survi1
	; PROBLEM RMSTKB failed! exstat = '<exstat>'
	; PAUSING for you to correct this problem before I re-try
	.pause
	.goto retry2
.survi1:
	;
	; *** we survived 'rmsat'
	;
	; pause to test rmstst program: see if we got a working RMS
	.pause
	; I will now try to build a remote RMS library
	; if you build a task against this library, it will transact messages
	; with a task RRTtnn (tnn is your terminal), and RRTtnn will contain
	; RMS code and buffers.
	.if <system> = 6 .goto gotmpl
	; WARNING you are not executing this command file on RSX-11M+
	; the remote RMS uses M+ executive directives VSRC and VRCS which
	; may not work on your operating system.
	.asks riskit do you want to build remote RMS anyway
	.iff riskit .exit <succes>
.gotmpl:
	.sets rmslb "LB:[1,1]RRMS.OLB"
	.sets wotlib "out-of-task_RMS_subfunctions"
	@incl sy:'<uic>'rrms remote_RMS 'rmslb' 'wotlib'
	@incl sy:'<uic>'rmspkt RMS_message_transactor 'rmslb' 'wotlib'
	; have now got complete remote rms library to build with
	; before we build a test task, we will make the remote rms
	; server task.
	@inc sy:'<uic>'rrmst remote_RMS_server_task
.retry5:
	; we will now use 'rmsat' to taskbuild server task
	@'rmsat' rrmst
	.if <exstat> = <succes> .goto survi5
	; PROBLEM 'rmsat' rrmst failed! <exstat> = '<exstat>'
	; PAUSING for you to correct the problem before I re-try
	.pause
	.goto retry5
.survi5:
	.sets rrmstn "[3,54]RRMST.TSK"
	@int rrmst remote_RMS_server_task
	@ini ...rrt $rrmst Remote_RMS_Server
	; now we try to run the remote rms task (gulp...)
	rrt
	; ok, we survived running RRTtnn for you
	; please leave it running, we need it for the programs we
	; are about to build and test.
	.sets rrmsat "LB:'<libuic>'RRMSTKB.CMD"
	.sets myat "SY:'<uic>'RRMSTKB.CMD"
	; pause so you can edit 'myat' before it becomes 'rrmsat'
	; most installations rewrite this COMPLETELY
	.pause
.retry3:
	@ink rrmstkb taskbuild_out-of-task_RMS_application
	; at last we can build the remote rms test task
	.; we already have rmstst.obj lying around
	;
	; *** we will now test logic of the 'rrmsat' that you made
	; *** by executing it from this command file
	; *** secure your crash helmet!
	;
	@rrmstkb rmstst
	.if <exstat> = <succes> .goto survi3
	; PROBLEM 'rrmsat' failed! <exstat> = '<exstat>'
	; PAUSING for you to correct this problem before I re-try
	.pause
	.goto retry3
.survi3:
	;
	; *** we survived 'rrmsat'
	;
	; pause to test rmstst program, the most recent one uses messages
	; to do RMS remotely.
	.pause
	; next we build two utility tasks:
	; RMSQIT.TSK	usually installed as ...QIT
	;	when run, sends a packet to RRTtnn to tell it to drop
	;	dead. RRTtnn will type a message if any RMS files are
	;	still open/active (usually indicates a program bug
	;	in your application where you forgot to call dropi() ).
	; RMSTRC.TSK	usually installed as ...TRC
	;	when run, sends a packet to RRTtnn which toggles the
	;	trace bit in RRttnn. So run it once to turn tracing on
	;	then run it again to turn tracing off.
	;	Tracing provides a nice(verbose) way to debug an
	;	application, or even to tune it.
	@inc rmsqit
	@rrmstkb rmsqit
	@int rmsqit remote_RMS_task_(RRTtnn)_killer
.retry4:
	rem ...qit
	@ini ...qit $rmsqit remote_RMS_task_(RRTtnn)_killer
	;
	; *** testing QIT command (i.e. RMSQIT.TSK)
	;
	qit
	.if <exstat> = <succes> .goto survi4
	; PROBLEM QIT failed! <exstat> = '<exstat>'
	; PAUSING for you to correct the problem before I re-try
	.pause
	.goto retry4
.survi4:
	;
	; *** survived QIT
	;
	; the remote rms server task RRTtnn should be gone
	; pausing to confirm this
	.pause
	@inc rmstrc
	@rrmstkb rmstrc
	@int rmstrc remote_RMS_server_(RRTtnn)_trace_toggler
	.close #1
	.close #2
	.close #3
	; OK, the installation is done.
	; to undo it, @cleanup
	; to backout of what we did, @cleanup THEN @backout
	; REQUIRE. is a file containing the goodies we need to execute
	; this command file. throw it away.
	tim
