Easy source control without SVN ?

robotop

Member
Licensed User
Longtime User
Hello, I like to split my programs in "sections", when them grow over certain size. Is there, in B4A, some directive like PHP "include" that I can use to make a long source more readable ? In short: may I do something like this:

#include "Process100.txt" ' all the instructions for my Process #100
#include "Process200.txt" ' the same for Process #200

putting two files called Process100.txt and Process200.txt in the same folder of main, then have them automatically included at compile time ?

Or:
it's possible to put in the source some "start marker" and "stop marker" that will hide the source in the middle, and make it visible again with some ctrl-Q typing ? I remember this feature was present in the old 16-bit GFW-Basic compiler for Windows...

Please, note that I can't split my application in modules due to many reasons that is long to explain, so it will be very useful to move around the code viewing it as list of includes, or hidden titled blocks.

Thank you for attention, I'll wait for some answer...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is recommended to use code modules to break your code to multiple components.

Code modules are pretty similar to such includes.

it's possible to put in the source some "start marker" and "stop marker" that will hide the source in the middle, and make it visible again with some ctrl-Q typing ? I remember this feature was present in the old 16-bit GFW-Basic compiler for Windows...
Yes. You can use #Region command:
B4X:
#Region Important region
Sub Activity_Resume

End Sub
Sub Activity_Pause (UserClosed As Boolean)

End Sub
#End Region
 
Upvote 0

robotop

Member
Licensed User
Longtime User
Thank you, Erel, for your prompt answer. I will test the #region and give some feedback to you :)

Edited: VERY GOOD !!! It's exactly what I was looking for. Great. Thanks.
 
Last edited:
Upvote 0

COBRASoft

Active Member
Licensed User
Longtime User
Regions are super handy, specially in 1.8. The editor closes all regions when opening a file for a better overview.

Erel: it would be super handy if we could select some code and press CTRL+" to place the code in a region. CodeRush allows me to do this in Visual Studio and it provides me a super fast workflow.
 
Upvote 0
Top