RAD Studio (Common)
ContentsIndex
PreviousUpNext
Using Code Folding

Code folding lets you collapse (hide) and expand (show) your code to make it easier to navigate and read. RAD Studio generates code that contains code folding regions, but you can add your own regions as needed.

To collapse and expand code

  1. In the Code Editor, click the minus (-) sign to the left of a code block to collapse the code.
  2. Click the plus (+) sign to expand the code block.
Tip: To turn off code folding for the current edit session, press and hold Ctrl+Shift
, and then K, and then O. To collapse the nearest code block, press and hold Ctrl+Shift, and then K, and E. To expand the nearest code block, press and hold Ctrl+Shift, and then K, and U. To expand all code, press and hold Ctrl+Shift and then press K, and A.

To add a code folding region

  1. In the Code Editor, use the following preprocessor directives to surround a block of code:

{$region 'Optional text that appears when the code block is folded'}
.
.
.
{$endregion}

 

#region Optional text that appears when the code block is folded
.
.
.
#endregion

 

#pragma region optional text
.
.
.
#pragma end_region

The region is marked with a minus (-) sign.

  1. Click the minus sign (-) to collapse the region.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!