Android Question Wish Code Beautify

Apip Bayok

Member
Hello everyone,

I work using B4A and write hundred line of code and sometime it's me make confused, for example:
B4A IDE Default style:
Sub exm(a As Int,v As Boolean)
    If a<>0 Then
        Log("this a="&a)
        Else
            If v=True Then
                Log(v)
                Else
                    Log("this is example")
            End If
    End If
End Sub
Private Sub example(a As Int)
    If a=1 Then
        Else If a=2 Then
            else if a=3 Then
                Else                    
    End If
End Sub

Wish be could like this:
Sub exm(a As Int,v As Boolean)
    If a<>0 Then
        Log("this a="&a)
    Else
        If v=True Then
            Log(v)
        Else
            Log("this is example")
        End If
    End If
End Sub

Private Sub example(a As Int)
    If a=1 Then
        
    Else If a=2 Then
        
    else if a=3 Then
        
    Else
                            
    End If
End Sub

is there a way to make it prettier with some shortcut or feature?
 

aeric

Expert
Licensed User
Longtime User
Have you tried Auto Format?

1643185056944.png
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
I want to suggest you to use a Select case instead a lots of If ElseIf Else and your code may results more readable.
 
Upvote 0
Top