Looking for work? Check out our jobs area.

Software Tools in Turbo Pascal

Theme Graphic
Theme Graphic

Software Tools in Turbo Pascal

I intend to go through SOFTWARE TOOLS IN PASCAL by Kernighan & Plauger and to re-write the programs they presented using Turbo Pascal, taking advantage of Turbo Pascal's improvements over the...

Subscribe

Author

I'm a retiree living in central Ohio. I've worked as an physicist, engineer, mathematician and programmer. Most of my experience has been with Fortran, Pascal and various versions of Basic. Pascal is by far my favorite language. I believe most of my programs are still in use.

Archive

Tags

Posted on Saturday, November 10, 2007 at 11:03 PM

Showing tabs

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 }
Comments: 0 Tags: None


corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.