Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

pascal
tokens
comments
communitycreator

Pascal Tokens Comments

Hifza Sohail

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.

RELATED TAGS

pascal
tokens
comments
communitycreator
RELATED COURSES

View all Courses

Keep Exploring