PROG3.PAS 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. PROGRAM PROG3;
  2. {$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
  3. New Topics: Comments
  4. Output with the Write and WriteLn statements
  5. Compiler directive - $U+
  6. Note that this block of comments, extending over several lines
  7. is included between a single set of brackets at the left.
  8. $U+ is a special form of comment, called a compiler directive.
  9. This directive, $U+, will appear in most of the sample programs
  10. to make sure you can terminate a program without having to reboot.
  11. (More about compiler directives later.)
  12. }
  13. (* Parentheses and asterisks can also be used to enclose a comment *)
  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. {The fact that statements can be temporarily killed by commenting them
  25. out illustrates the usefulness of a second type of comment delimiter.
  26. Try killing several of the WriteLn statements above by inserting
  27. (* to the left of the first statement to be killed and
  28. *) to the left of the statement AFTER the last statement to be killed.
  29. Run the program to see the results.
  30. }
  31. WriteLn;
  32. Write ('Check carefully when ');
  33. Write ('you run this program. ');
  34. Write ('How many lines ');
  35. WriteLn('are printed');
  36. WriteLn('by this last set of Write and WriteLn statements?');
  37. END. {PRG3}
  38.