next up previous contents
Next: Simple Variables Up: Printing to the Output Previous: Commenting   Contents

Formatting

Pascal is a free form language. This means unless they are within single quote pairs, multiple spaces is considered the same as one space, line breaks are also considered spaces. I could have written the program like the following with no change of behavior:

begin
  writeln('Tak Auyeung');
    writeln('999 Milky Way');
      writeln('Galaxy, UV 99999')
        end.

I can even write everything on one single line. The formatting of a program does not bother the computer at all, but it may bother you. This is especially the case when a program gets large.

As a good habit, you should always indent everything between begin and end by a fixed number of spaces. The importance of doing this becomes more important when we talk about structured programming.


Tak Auyeung 2003-12-03