Introduction to the Pascal Programming Language

© 1998 by Dr. Thomas W. MacFarland -- All Rights Reserved


     Instructions:   Review the following program and see if you can 
                     predict the outcome by completing a "pencil 
                     trace" of the code.  

                     Program output is provided at the end of this 
                     page.

     Compiler:       The program was prepared using Standard Pascal 
                     on a UNIX-based host computer.


% cat PASCAL/intro_pencil-17.p
{ Introduction to the Pascal Programming Language
  Dr. Thomas W. MacFarland
  intro_pencil-17.p       
}

{ The purpose of this program is to:

  1.  Demonstrate the curley brace symbols used to make comments 
      in a Pascal program.

  2.  Demonstrate the ( and * symbols which are also used to make 
      comments in a Pascal program, which was the norm before
      modern keyboards included the curley brace symbols.
}

program Demonstrate_the_Use_of_Comments;

begin { Main program }

  (* This comment is ignored by the Pascal compiler. *)
  {  This comment is also ignored.                    }

  writeln('Too much programming [hurts] {your} (*eyes*) ');
  writeln('I am //told!');

end. (* This is the end of the main program *) 
     { intro_pencil-17.p      } 
% pc PASCAL/intro_pencil-17.p
% a.out
Too much programming [hurts] {your} (*eyes*) 
I am //told!

Please send comments or suggestions to Dr. Thomas W. MacFarland

There have been visitors to this page since February 1, 1999.