1. Home
  2. Computing & Technology
  3. Delphi Programming
Zarko Gajic
Zarko's Delphi Programming Blog

By Zarko Gajic, About.com Guide to Delphi Programming

Create Collapsible Code Blocks in Delphi Code Editor using the {$REGION} directive

Friday November 13, 2009

in Delphi TIPS ::

In Delphi 2006 (both Win32 and .Net) you can apply a special {$REGION 'Region Name'} directive to mark a "named" collapsible regions in the code editor.

To mark code as a region, surround it with the REGION and ENDREGION directives. You may include a caption that will be displayed when the code is folded and hidden.

Read the full tip to learn how to Create Collapsible Code Blocks in Delphi Code Editor using the {$REGION} directive.

Related: A First Look at (Borland Developer Studio) Delphi 2006 | Using Delphi Compiler Directives | How to enable .NET Compiler Warnings when using the dcc32 compiler?

Comments
November 13, 2009 at 10:08 am
(1) Ken Knopfli says:

How do I stop them from jumping open all the time?

The slightest syntax error, and you can go through your entire file closing the ones you don’t want right now.

C# regions do not do that. (I have D2007)

November 13, 2009 at 5:06 pm
(2) Brian E says:

You can’t since the collapsed/expanded state of regions in Delphi isn’t saved. It’s a useless feature as implemented because the collapsed state is so transient.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

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

All rights reserved.