Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/25/sutind.sim
There is 1 other file named sutind.sim in the archive. Click here to see a list.
OPTIONS(/l/page:"SUTIND, SIMULA version");
BEGIN
REF(Infile)input,indin;
REF(Printfile)output,indout;
TEXT inrec, outrec;

TEXT revision_date,revision_number;
TEXT line_start, save_id;
TEXT producer_id,document_id,date_id, pn;
INTEGER page_limit, page_no, item_no, left_margin;
INTEGER line_width;
INTEGER l;
line_width := 80;
left_margin := 5;
page_limit:=58;

outrec:-Blanks(line_width);
inrec:-outrec.Sub(left_margin+1,line_width-left_margin);
save_id:-Blanks(inrec.Length);
line_start:-inrec.Sub(1,4);
input:-Sysin; output:-Sysout;
indin:-NEW Infile("TDINDX.IND");
indout:-NEW Printfile("TDINDX.LST");

producer_id:-Copy("E N E A");
document_id:-Copy(
"SIMULA FOR DEC SYSTEM 10      TD, INDEX               VII-    ");
pn:-document_id.Sub(document_id.Length-3,3);
date_id:-Copy(
"741118   yymmdd  00                             Olof Bjorner");
revision_date:-date_id.Sub(10,6);
revision_number:-date_id.Sub(18,2);
indout.Linesperpage(page_limit);

INSPECT input DO
BEGIN ! initial dialogue;
    Outtext("START of INDEX editing"); Outimage;
    Outtext("Enter revision date (yymmdd):"); Breakoutimage;
    Inimage; revision_date:=Image.Strip;
    Outtext("Enter revision_number (nn):"); Breakoutimage;
    Inimage; revision_number:=Image.Strip;
END initial dialogue;

INSPECT indin DO
BEGIN
    Open(inrec);
    INSPECT indout DO
    BEGIN   !output index;
	Open(outrec);
	Outimage;
	Eject(15);
	Setpos(15);
	Outtext("INDEX"); Outimage;
	Eject(1);

	Inimage;

	WHILE NOT Endfile DO
	BEGIN
	    l:=Line;
	    IF l=1 OR l>page_limit THEN
	    BEGIN !heading;
		save_id:=inrec;
		Eject(1);
		inrec:=producer_id; Outimage;
		Eject(5);
		page_no:=page_no+1; pn.Putint(page_no);
		inrec:=document_id; Outimage;
		Eject(7);
		inrec:=date_id; Outimage;
		Eject(11);
		inrec:=save_id;
	    END heading;

	    IF line_start = " ___"
	    THEN item_no:=item_no-2 !compensate for the 3 lines;
	    ELSE item_no:=item_no+1;

	    Outimage;
	    Inimage;
	END while not endfile;
	Close;
    END INSPECT indin;
    Close;
END INSPECT indout;
Outtext("End of INDEX"); Outimage;
Outtext("Number of items in index:"); Outint(item_no,5);
Outimage;
END of program;