Pascal Tokens Comments

Types of Comments in Pascal

Old Style Comment

This is the old style of commenting in Pascal. It is not used much anymore, but it still works if you’d prefer to use this method.

(*Comment*)

Turbo Style Comment

The Turbo style comment can be used for multiple lines.

{ Comment }

Delphi Comment

The Delphi comment is good to use for a single line.

// This comments the whole line

Nested Comments

You can also do nested comments, as shown below. There are several different ways to do this.

Example 1

{  First Comment (*  second comment *) }

Example 2

(* First Comment { second comment } *)

Example 3

{ first comment //  Second Comment }

Example 4

(* first comment // Second Comment *)

Example 5

// first comment (* second comment *)

Example 6

// first comment { second comment }

The nested comments that start with // should be in one line. It will be invalid otherwise.

Free Resources