Wish Auto spacing in code lines

SPLatMan

Member
Licensed User
Longtime User
A feature of Visual Basic's editor I find useful is that it "normalises" the spacing on code lines. For example, if I type
B4X:
x=89
the editor automatically inserts spaces to make it
B4X:
x = 89
. This not only makes the program a little neater, but makes it easier to find all cases of assigning a value to x.
 

RVP

Active Member
Licensed User
Longtime User
I would take it a bit further. A lot of development tools will 'pretty' format for you. So if I put in
B4X:
If x>2 Then
    They will indent the next series of lines until
    I type
End If

Then the indent will move back. This makes it far easier to see if your program flow is what you think it is going to be, as well as just plain makes code easier to read.
 

ivan.tellez

Active Member
Licensed User
Longtime User
I really love this on vb6 it has LOTS of advantages

for example a simple serach of "x=89" it will not find "x= 89" nor "x =89" not even "x = 89"

Best practices to code is to allways have "normalized" code, but currently its time consuming and sometimes you forgot to do it in some lines of code.

+1
 

MikeH

Well-Known Member
Licensed User
Longtime User
Yes, I do this manually but it would help if it was automatic.

Maybe even having styles whereby you can set your own spacing, rules etc?

I wonder if there is a recommended layout for code or do we just do our own thing?
 

Tom Law

Active Member
Licensed User
Longtime User
Have you tried out the B4a Code Formatter? (search for it on this site).
 
Top