Comments
are inserted into Pascal programs by enclosing the comment
within { and } braces. Comments are ignored by the computer, but
are helpful to explain how the program works to other
programmers.
A Pascal program with comments
program DEMOPROG (output);
begin
write('Hello there.');
{the write statement does not set the cursor
to the beginning of the next line. }
writeln('This is getting boring.')
{ This is printed on the same line as Hello
there, but now the cursor moves to the beginning
of the next line, because this time we used writeln
instead of write }
end.
Sample Program Output
Hello there. This is getting boring.
_
© Copyright B Brown/P Henry, 1988-2000. All rights reserved.