// OREMARK. SR

// Last modified October 25, 1979  6:54 PM by Taft

get "bravo1.DF";
get "CHAR.DF";
get "MSG.DF";
get "rn1.df"
get "com.df"
get "doc.df"
get "vm.df"
get "select.df"

// Incoming procedures

external
	[
	SetRegionSys
	uc;
	PutSbScr;
	insertd;
	bravochar;
	stcopy;
	stappend;
	updatedisplay;
	inserttx;
	inserta;
	setsel;
	blinkscreen;
	]

// Incoming statics

external
	[
	deltacp;
	sbstate;
	sbpast;
	rgsbcom;
	comno;
	cpscrt;
	selaux;
	rgmaccp;
	vmeasurestatus;
	look1std
	look2std
	]
// Outgoing procedures

external
	[
	remarkcom;
	]

// R E M A R K C O M
//
let remarkcom() = valof
[
unless vmeasurestatus then
	[ blinkscreen()
	SetRegionSys(risyspast,26)
	updatedisplay()
		[ 
		] repeatuntil bravochar() eq chdel
	SetRegionSys(risyspast,15)
	resultis abmsg
	] 
let trid = 0
let tchar = bravochar();
if tchar eq chdel then
	[
	SetRegionSys(risyspast,10,50)	//remark command terminated
	resultis abmsg
	] 
tchar = uc(tchar);
trid = valof
	[
	if tchar eq $E resultis 118
	if tchar eq $F resultis 119
	resultis 120
	]
// Type or select (trid) terminated by escape
SetRegionSys(risysstate,36,trid,37);
updatedisplay();
unless inserttx(1) then
	[
	SetRegionSys(risyspast,10,50)	//remark command terminated
	resultis abmsg
	] 
let oldmaccp = rgmaccp ! docremark;
let tsbdesc = vec 5;
tsbdesc ! 0 = #400+tchar;
let tsb = vec 5;
stcopy(tsb," ");
stappend(tsb,tsbdesc);
stappend(tsb," ");
deltacp = 0;
let bifr = PutSbScr(tsb,look1std,look2std);
insertd(docremark,oldmaccp,deltacp,fnscr,cpscrt,bifr);
cpscrt = cpscrt+deltacp;
unless inserta(docremark,rgmaccp ! docremark,doctx1,0,rgmaccp ! doctx1-1) do
	[
	SetRegionSys(risyspast,10,50)	//remark command terminated
	resultis abmsg
	]
selaux >> SEL.doc = docremark;
selaux >> SEL.ww = -1;
selaux >> SEL.type = schar;
setsel(selaux,oldmaccp,rgmaccp ! docremark-1);
resultis abnil
]