home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
TURBO-06.ZIP
/
STRIPTAB.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-02-23
|
2KB
|
66 lines
{.HE Striptab - J. Wichman}
{.PL66}
PROGRAM STRIPTAB; {Strips tabs from source code
and rewrites the file. }
var InFile, OutFile : text; {Input and Output Files}
LineIn, OutLine : string[255]; {Input and Output lines}
const tab = ^I; {Define a 'tab'}
{.cp10}
procedure StartIO; {Opens files, etc.}
var Xoutput, Xinput: string[14];
begin;
writeln
(con,'STRIPTAB program (Replaces a "tab" with a "space"- J. Wichman');
writeln(con,'');
write('Input File name: ');
BufLen := 14;
Readln(con,Xinput);
assign (InFile,Xinput); {open input file}
reset(InFile);
write('Output file name: ');
BufLen := 14;
Readln(con,Xoutput);
assign(OutFile,xoutput);
end; {End of StartIO}
{.cp10}
procedure DoStrip;
var CTab,CLine,I : integer;
begin;
rewrite(OutFile);
CTab := 0; CLine := 0;
while not eof(InFile) do
begin;
Readln(InFile,LineIn);
CLine := CLine + 1;
for I := 1 to length(LineIn) do
begin;
while LineIn[I] = tab do
begin;
LineIn[I] := ' ';
CTab := CTab + 1;
end;
end;
writeln(OutFile,LineIn);
end;
writeln(con,'Lines read = ',Cline);
writeln(con,'Tabs replaced = ',CTab);
end;
{.cp10}
procedure closem;
begin;
close (InFile);
close (OutFile);
end;
{.cp10}
begin {The REAL program starts here.}
StartIO;
DoStrip;
closem;
end. {My, That was quick...}