home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / T_LESSON.ZIP / PROG3.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-03-31  |  1.7 KB  |  42 lines

  1. PROGRAM PROG3;
  2. {           Copyright (C), 1989 by Lyle Faurot.  All rights reserved.
  3.  
  4.    New Topics: Comments
  5.                Output with the Write and WriteLn statements
  6.  
  7.    Note that this block of comments, extending over several lines
  8.    is included between a single set of brackets at the left.
  9.  
  10. }
  11.  
  12. (*  Parentheses and asterisks can also be used to enclose a comment *)
  13.  
  14. BEGIN
  15.   WriteLn('* * * * * * * * * * * * * * * * * *');  {Note that comments      }
  16.   WriteLn('*                                 *');  {placed at the end of a  }
  17.   WriteLn('*          TURBO-LESSON 3         *');  {statement line should   }
  18.   WriteLn('*                                 *');  {be bracketed on the     }
  19.   WriteLn('*  Edited, Compiled, Executed by  *');  {same line.  A multiline }
  20.   WriteLn('*       (put your name here)      *');  {comment, like the one at}
  21.   WriteLn('*                                 *');  {the beginning of this   }
  22.   WriteLn('* * * * * * * * * * * * * * * * * *');  {program would include   }
  23.   {    some of the non-comment statements, making them ineffective.         }
  24.  
  25.   {The fact that statements can be temporarily disabled by commenting
  26.    them out illustrates the usefulness of a second type of comment delimiter.
  27.  
  28.    Try disabling several of the WriteLn statements above by inserting
  29.    (*  to the left of the first statement to be disabled and
  30.    *)  to the left of the statement AFTER the last statement to be disabled.
  31.        Run the program to see the results.
  32.   }
  33.  
  34.   WriteLn;
  35.   Write  ('Check carefully when ');
  36.   Write  ('you run this program. ');
  37.   Write  ('How many lines ');
  38.   WriteLn('are printed');
  39.   WriteLn('by this last set of Write and WriteLn statements?');
  40.  
  41. END. {PROG3}
  42.