Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

How to comment out large amount of source code

By Zarko Gajic, About.com

To comment a simple line of code you could use // before that line. To comment few lines you could use { } or (* *). But, if you have a large amount of code that you want to comment out, none of the above operators may help, depending on whether you have already used those operators in the code. Here's a definitive way to comment out code:

{$IFDEF False}

your commented
code goes here

{$ENDIF}

Delphi tips navigator:
» How to delete 'Temporary Internet Files' from code
« How to place a TCheckBox inside a TRichEdit

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2002 Delphi Tips
  7. How to comment out large amount of source code

©2009 About.com, a part of The New York Times Company.

All rights reserved.