Posted on Saturday, November 10, 2007 at 11:03 PM
Some files contain TABs, Chr(9), as a form of modest compression. When a program displaying the file encounters a TAB it prints out a series of one or more blanks. The next two programs insert and remove TABs. To test these programs we will need a program that displays the tabs. This program substitutes a ^ for the tab so we can see the file's true contents.
Program ShowTabs ;
{
ShowTabs -- display tabs in a file.
}
Uses
Tools ; { TAB and CARET ( ^ )}
Var
Ch : Char ;
begin { ShowTabs }
while NOT eof do begin
Read (Ch) ;
if Ch = TAB then
Ch := CARET ;
Write (Ch)
end
end. { ShowTabs }