Code line split

gjoisa

Active Member
Licensed User
Longtime User
How to split a long code line ? I have a string array , with an index of 50 strings . I want to split the code line .:sign0085:
 

pluton

Active Member
Licensed User
Longtime User
Use underscores :)

B4X:
words = Array As String _
("First ",  flavor.", _
"Some.", _
"Other", _
"Words.", _
"I don't know.", _
"Why ")
 
Upvote 0

Rui

Member
Licensed User
Longtime User
You can also use the colon : to join two lines

B4X:
Dim Undo As Boolean: Undo=True
 
Last edited:
Upvote 0

dexMilano

Active Member
Licensed User
Longtime User
Sorry,
I tried to use this approach to slit lines in a type declaration but I've an error.
Is it possible to do it?

B4X:
Type the_activity _
        (activity_id As Int, _
        'standard activity fields
        title As String, _
        description As String, _
        notes As String, _
        status As Int)

Thanks

dex
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
This should work for you:
B4X:
Type the_activity _
        (activity_id As Int, _
        title As String, _
        description As String, _
        notes As String, _
        status As Int)     'standard activity fields
 
Upvote 0

dexMilano

Active Member
Licensed User
Longtime User
You're right Mahares
so I cannot put comments in the middle.

it could be useful to split logically the groups.
Any possibility to do something similar?

Thanks

dex
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Remember to make a space before the underscore...
B4X:
'wrong split example:
aString () = "abc",_
"def"

B4X:
'Correct split example:
aString () = "abc", _
"def"
 
Upvote 0
Top