home *** CD-ROM | disk | FTP | other *** search
- -h- kwic.cmd 189
- { kwic -- make keyword in context index }
- procedure kwic;
- const
- FOLD = DOLLAR;
- var
- buf : string;
- {$include:'putrot.kwi'}
- begin
- while (getline(buf, STDIN, MAXSTR)) do
- putrot(buf)
- end;
-
- -h- kwic.pas 298
- {$debug-}
- program outer (input,output);
-
- {$include:'globcons.inc'}
- {$include:'globtyps.inc'}
-
- {$include:'initio.dcl'}
- {$include:'flush.dcl' }
-
- {$include:'getline.dcl' }
- {$include:'isalphan.dcl'}
- {$include:'putc.dcl' }
-
- {$include:'kwic.cmd' }
- BEGIN
- minitio; initio;
- kwic;
- flush(0);
- END.
- -h- kwic.mak 84
- kwic+initio+getfcb+error+getarg+nargs+flush+
- getline+getcf+getc+putc+isalphan+putcf
- -h- putrot.kwi 372
- { putrot -- create lines with keyword at front }
- procedure putrot (var buf : string);
- var
- i : integer;
- {$include:'rotate.kwi'}
- begin
- i := 1;
- while (buf[i] <> NEWLINE) and (buf[i] <> ENDSTR) do begin
- if (isalphanum(buf[i])) then begin
- rotate(buf, i); { token starts at "i" }
- repeat
- i := i + 1
- until (not isalphanum(buf[i]))
- end;
- i := i + 1
- end
- end;
-
- -h- rotate.kwi 283
- { rotate -- output rotated line }
- procedure rotate (var buf : string; n : integer);
- var
- i : integer;
- begin
- i := n;
- while (buf[i] <> NEWLINE) and (buf[i] <> ENDSTR) do begin
- putc(buf[i]);
- i := i + 1
- end;
- putc(FOLD);
- for i := 1 to n-1 do
- putc(buf[i]);
- putc(NEWLINE)
- end;
-