Code folding - #Region

Erel

B4X founder
Staff member
Licensed User
Longtime User
One new feature of version 5.50 is code outlining (code folding).
You can use it to organize your code into blocks.
Each sub can be folded.
Using #Region ... #End Region you can manually declare blocks of code that will be foldable and also will be folded by default when you load the file.
That way you can easily navigate large code.
Note that you can add a description next to #Region.
Example:
B4X:
#Region Form1 Block
Sub Form1_Show
...
End Sub
Sub SomeSub
...
End Sub
...
#End Region
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Erel
Formidable!!!
This reminds me, (perhaps I just missed it), is it possible to fold and unfold all subs in a single action?
Cheers
Robert
 

alfcen

Well-Known Member
Licensed User
Longtime User
Absolutely no problem Erel,
By the speed of your updates I'm sure this will be intregrated sooner than I estimate :)
 

Rioven

Active Member
Licensed User
Longtime User
The folding feature is very useful. I could organise the coding very effectively.
The folded regions are stored once the file saved, but subs are not.
Is the folded subs will be stored too on your next update?
 
Top