Re: Great undocumented feature: foldable code with $REGION directive
From: Mauro Venturini (m_v_at_acm.org)
Date: 12/04/04
- Next message: Deborah Pate (TeamB): "Re: My Latest CodeFez Article"
- Previous message: Nick Hodges [TeamB]: "Re: My Latest CodeFez Article"
- In reply to: Marcelo Carvalho: "Great undocumented feature: foldable code with $REGION directive"
- Next in thread: Marcelo Carvalho: "Re: Great undocumented feature: foldable code with $REGION directive"
- Reply: Marcelo Carvalho: "Re: Great undocumented feature: foldable code with $REGION directive"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 4 Dec 2004 17:01:54 +0100
You might be interested in Nick Hodges article at
http://www.codefez.com/Default.aspx?tabid=79&newsType=ArticleView&articleid=51
and in my little submission at Code Central
http://cc.borland.com/ccweb.exe/listing?id=22853
"Marcelo Carvalho" <mc_nospam@arquivo.com.br> wrote in message
news:41b1ddac@newsgroups.borland.com...
> Hi,
>
> Having my first contact with C# IDE on D2005, I noticed a different
> rectangle, that was "hiding" a piece of auto-generated code. It was the
> #REGION directive. Than I saw the same kind of region in the Delphi.Net
> IDE, as the {$REGION} directive. Immediately I tried it in the Win32
> IDE and. it worked!
>
> The syntax is:
>
> .
> {$REGION 'Any title you want'}
> .
> // Any piece of code
> .
> {$ENDREGION}
> .
>
> After typing it, when you place the cursor back on the {$REGION}
> line, a small [+] appears near the line numbers - and you have a
> foldable piece of code! Closing it provides a nice rectangle hiding all
> code between the directives, showing the title you typed.
>
> This resource allow you to organize code easily, and is a great
> complement for the similar foldable methods and procedures. You can
> fold logical pieces of code, group code to turn complex structured
> blocks easy to read, group procedures and functions by categories,
> group variable declarations, and so on. You can even see all your unit
> folded code in one single screen!
>
> The regions CAN be nested, and they keep the indentation of the
> {$REGION} directive when folded. You can also customize it's colors
> when folded and unfolded.
>
> Of course there's space for enhancements: The main one, as pointed
> by Nick Hodges, would have some "Make selected code a region" as a
> right click. Also I'd like to be have a parameter so set color for
> individual regions (to categorize them), and have a shortcut do fold
> all regions and methods...
>
> I was wondering why such great resource is undocumented, not even
> being showed in the Borcons demos - it would be a success there, I'm
> sure. My first thought is that maybe because it is derived from some C#
> or VB resource. Observing many people being surprised when I mentioned
> it I decided to share it here.
>
> [][][][]
>
> Marcelo.
- Next message: Deborah Pate (TeamB): "Re: My Latest CodeFez Article"
- Previous message: Nick Hodges [TeamB]: "Re: My Latest CodeFez Article"
- In reply to: Marcelo Carvalho: "Great undocumented feature: foldable code with $REGION directive"
- Next in thread: Marcelo Carvalho: "Re: Great undocumented feature: foldable code with $REGION directive"
- Reply: Marcelo Carvalho: "Re: Great undocumented feature: foldable code with $REGION directive"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|