home *** CD-ROM | disk | FTP | other *** search
- -h- unique.cmd 309
- { unique -- remove adjacent duplicate lines }
- procedure unique;
- var
- buf : array [0..1] of string;
- cur : 0..1;
- begin
- cur := 1;
- buf[1-cur][1] := ENDSTR;
- while (getline(buf[cur], STDIN, MAXSTR)) do
- if (not equal(buf[cur], buf[1-cur])) then begin
- putstr(buf[cur], STDOUT);
- cur := 1 - cur
- end
- end;
-
- -h- unique.pas 300
- {$debug-}
- program outer (input,output);
-
- {$include:'globcons.inc'}
- {$include:'globtyps.inc'}
-
- {$include:'initio.dcl'}
- {$include:'flush.dcl' }
-
- {$include:'getline.dcl' }
- {$include:'equal.dcl' }
- {$include:'putstr.dcl' }
-
- {$include:'unique.cmd' }
- BEGIN
- minitio; initio;
- unique;
- flush(0);
- END.
- -h- unique.mak 90
- unique+initio+getfcb+error+getarg+nargs+flush+
- getline+getcf+getc+putstr+putc+putcf+equal