Setting #Region Form the IDE menu

Cableguy

Expert
Licensed User
Longtime User
Hi, I've noticed that the more experienced programers tend to "clean-up" the IDE screen with a bunch of #region's...
I've tryed to do that, but it only get the #Region and #End Region strings highlighted in red...
And I do can collapse the code..
SO ....the ability to define Regions from the IDE menu, would be of great help...
Yes I known we can already colpase the subs...
But imagine I have a prog with a few dozen subs, and could reduce them to only 3 or 4 colapsable Regions...
that would tidy up my IDE's screen...
 
Last edited:

agraham

Expert
Licensed User
Longtime User
But imagine I have a prog with a few dozen subs, and could reduce them to only 3 or 4 colapsable Regions...
that would tidy up my IDE's screen...
I'm afraid that I don't understand the problem. Why can't you do that with #Region and #End Region? :confused:
 

Cableguy

Expert
Licensed User
Longtime User
it would just be easier to use, thats all...
just like the Comment feature...
define a piece of code, select region and that all...
 

Zenerdiode

Active Member
Licensed User
Just use:

B4X:
#Region <Region Name> 'Optional comment text
Sub FirstSub
   MsgBox("FirstSub")
End Sub

Sub SecondSub
   MsgBox("SecondSub")
End Sub
#End Region

The next time you open your code in the IDE the region will be collapsed as default. You are remembering to name the region, aren't you?
The region may be collapsed manually as soon as it is created.
 

Cableguy

Expert
Licensed User
Longtime User
What I was sugesting was to be able to do it from one of the IDE's menu, just like the Block Commenting feature...
 

Cableguy

Expert
Licensed User
Longtime User
Another related feature would be that the subs that were colapsed( not by #Region but by b4ppc) at exit time, would be colapsed at load time...
At the moment ALL subs apear expanded at load time...
 
Top