Google
 

Trailing-Edge - PDP-10 Archives - steco_19840320_1er_E35 - 10,5676/teco/macros/help.tco
There is 1 other file named help.tco in the archive. Click here to see a list.
!; TECO ON-LINE HELP SYSTEM -- Last Revised: March, 1979 !
!; Author: Clive B. Dawson  -- Univ. of Texas at Austin !
!; Editor: James C. Simpson -- National Security Agency !
!; This TECO macro does keyword searches in TECHLP.TXT !

	[a[b[c[d[e[f[g[h[i[j[k[z	!;Save Q-registers!
	EOUj 				!;Save current EO level!
	0UK				!; Assume not video mode !
	0EO	EO-4+1"G		!; Check if we might have video mode !
		EVMODE$Uk		!; Save current state of display !
		EVOFF$'			!; And turn off the display !
	0EO				!; Set EO level to not complain about args !
	^AHelp is on the way!^A :13,1^T :10,1^T  !;For the impatient...!
	ETUh 1ET			!;Save ET, set to literal typeout!
	^XUi 0^X			!;Save ^X, set to either case!
	HXa .Ub HK			!;Save buffer, pointer, and clear it!
	13I$ 10I$ HXf HK		!;Put crlf in Qf for typeout!
	EPted:techlp.txt$ [*]g		!;Get help text and save it in Qg!
	Gg ZUz				!;Put it in buffer and save length!

	EIted:getnam.tec$		!;Get user's name!
	G0 :.,QzS^N $"U QzJ'		!;Put in buffer, backup to non-blank!
	^AHi, ^A Qz,.T Qz,ZK		!;Type and delete user's name!
	^A...Type HELP<esc> for basic help.^A Qf= !;and rest of the greeting!

!PRMPT!	:11^T$ 0ET			!;Clear Control-O, set normal typeout!
	Qf= ^A-^A			!;Type the prompt!
	QzJ				!;Go to end of text!
!GETCH!	^TUc				!;Get a character!
	Qc-^o10 "E Qz-."E OPRMPT$ ' ^A ^A :^o10,1^T -D OGETCH$ ' !;^H!
	Qc-^o177"E Qz-."E OPRMPT$ ' .-1,.T          -D OGETCH$ ' !;<DEL>!
	Qc-^o25 "E ^A^U^A Qz,.K			       OPRMPT$ ' !;^U!
	Qc-^O022"E Qf= ^A-^A  Qz,.T		       OGETCH$ ' !;^R!
!GETC1!	Qc-^O037"G QcI$ OGETCH$'	!;If not a control char, put in buffer!
	Qc-^O015"L      OFIXIT$'	!;^@ thru ^L are normal control chars!
	Qc-^O015"E ^T$  OGOTIT$'	!;<CR> ends the string (eat LF)!
	Qc-^O033"E      OGOTIT$'	!;<ESC> ends the string!
					!;Rest are normal control chars!

!FIXIT!	^O136I$ Qc+^O100I$		!;Insert control chars in arrow format!
	OGETCH$				!;Go get next character!

!GOTIT!	Qf=				!;Got the string, echo a crlf!
	Qz-."E OEND$'			!;If null string, quit!
	Qc-^O033"E QzJ I^R^R^R^A$ ZJ'	!;If <ESC> delimiter, insert a ^A!
	Qz,ZX* Qz,ZK			!;Save and delete search string!
	J 0Ue				!;Go to the top and flag no match yet!
	1ET				!;Set literal typeout!
!SERCH!	:S^G*$"U OFAIL$'		!;Search for string!
	1A-3"E .,ZT OPRMPT$'		!;If followed by ^C, type rest of text!
	1A-4"E .Ud 			!;If followed by ^D, type up to a ^C!
	       :S^R^C$"U ZJ' L
	       Qd,.T OPRMPT$
	    '
	:-S^R^E$"U 0L' .Ud 		!;Search back to ^E!
	1A-2"E L OSERCH$'		!;Ignore match if ^B at start of line!
	:S^R^B$"U' L Qd,.T 1Ue		!;Type up to ^B, and set flag!
	OSERCH$				!;Keep searching!

!FAIL!	Qe"N OPRMPT$'			!;If a match was found, ok!
	^ASorry.  I can't find help for ^A !;Tell user we found nothing!
	Q*= Qf= OPRMPT$			!;And start again!

!END!	HK Ga QbJ QhET Qi^X QjEO	!;Restore buffer, pointer, flags!
	Qk"N	EVON$'			!; If video was on, turn it back on !
	]z]k]j]i]h]g]f]e]d]c]b]a	!;Restore Q-regs!
	0U* EC				!;Clear Q* and reduce core!