Re: Great undocumented feature: foldable code with $REGION directive

From: Mauro Venturini (m_v_at_acm.org)
Date: 12/04/04


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.



Relevant Pages

  • Re: Visual C++ 6 support issue
    ... >> A common IDE is a good idea, but usually in programming, you have ... >would do what made sense for that language. ... >or at least for allocating resource ID values within specified ranges. ... >That is, for example, I'd like to keep all the help strings and all the ...
    (microsoft.public.vc.mfc)
  • Re: Great undocumented feature: foldable code with $REGION directive
    ... to place the two Regionalize files in the BDS bin folder. ... >> all code between the directives, ... >> unit folded code in one single screen! ... >> I was wondering why such great resource is undocumented, ...
    (borland.public.delphi.non-technical)
  • Re: Resource-Files in Text-Editor
    ... > Den MS Resource Compiler findest Du auf der bzw. einer Deiner VB-CD's. ... > es sich um ein Programm handelt, das von der Befehlszeile aus ausgeführt ... [Sprache/Landeskennung unterschiedlich in IDE vs kompilierter Exe] ... Ressourcen sowohl in der IDE von VB als auch zur Laufzeit ...
    (microsoft.public.de.vb)
  • Re: Visual C++ 6 support issue
    ... > A common IDE is a good idea, but usually in programming, you have ... or at least for allocating resource ID values within specified ranges. ... That is, for example, I'd like to keep all the help strings and all the ...
    (microsoft.public.vc.mfc)
  • Great undocumented feature: foldable code with $REGION directive
    ... rectangle, that was “hiding” a piece of auto-generated code. ... IDE, as the directive. ... code between the directives, ...
    (borland.public.delphi.non-technical)