Since Pascal ignores end-of-lines and spaces, punctuation is needed to tell the compiler when a statement ends.
You must have a semicolon following:
Indenting is not required. However, it is of great use for the programmer, since it helps to make the program clearer. If you wanted to, you could have a program look like this:
But it's much better for it to look like this:
In general, indent each block. Skip a line between blocks (such as between the const and var blocks). Modern programming environments (IDE, or Integrated Development Environment) understand Pascal syntax and will often indent for you as you type. You can customize the indentation to your liking (display a tab as three spaces or four?).
Proper indentation makes it much easier to determine how code works, but is vastly aided by judicious commenting.
<<< Previous | Table of Contents | Next >>> |