perm filename LABELS.SAI[S,AIL] blob sn#058517 filedate 1973-08-18 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	BEGIN "LABELS"
C00005 ENDMK
C⊗;
BEGIN "LABELS"
  REQUIRE "COMLIN" LOAD_MODULE;
  EXTERNAL BOOLEAN PROCEDURE COMLIN(STRING S1,S2; BOOLEAN FLAG);
  STRING FILE,LINE,S;
  INTEGER PAGE,LIN,BRK,EOF,FLAG;
  DEFINE CRLF="('15&'12)", FF='14;
  OPEN(1,"DSK",0,2,0,200,BRK,EOF);
  OPEN(2,"DSK",0,0,2,0,FLAG,FLAG);
  OUTSTR("WRITING LABELS.TMP
");ENTER(2,"LABELS.TMP",FLAG);
  SETBREAK(1,'12&'14,NULL,"INA");
  SETBREAK(2,":",NULL,"I");

  FOR FILE←"INTRO","C.11","C.21","C.22","C.23","C.31",
	"C.32","C.33","C.41","C.42","C.51","C.52","C.61",
	"C.71","C.72","C.81","SYNTAX","LEAPP","CONTEN","BIB" DO
  BEGIN "FILELOOP"
	PROCEDURE WRITELINE;
	  OUT(2,CVS(LIN)&"/"&CVS(PAGE)&"  "&LINE);
	OUT(2,FILE&CRLF&CRLF);
	LOOKUP(1,FILE,FLAG); IF FLAG THEN CONTINUE "FILELOOP";
	OUTSTR("  READING "&FILE&CRLF);
	EOF←0;
	FOR PAGE←1 STEP 1 UNTIL 99999 DO BEGIN "PAGELOOP"
	  FOR LIN←1 STEP 1 UNTIL 99999
	   DO BEGIN "LINELOOP"
		LINE←INPUT(1,1);
		IF EOF THEN DONE "PAGELOOP"; IF BRK=FF THEN DONE "LINELOOP";
		IF LINE≠"." THEN CONTINUE "LINELOOP";
		S←LINE; SCAN(S,2,BRK); IF BRK=":" THEN WRITELINE ELSE
		FOR S←"PAR","SECT","CHAP","GENFIG","FFIG","TTAB","FNTYPE" DO
		  IF COMLIN(S,LINE[2 FOR LENGTH(S)],1) THEN
			WRITELINE
	   END "LINELOOP"
	END "PAGELOOP";
	OUT(2,FF); CLOSE(1)
  END "FILELOOP";
  RELEASE(2); RELEASE(1)
END "LABELS";