B4J Question what is the code line extension character?

colin van Blommestein

Member
Licensed User
Longtime User
I'm creating a sql definition but run out of visible line space
What character do I use to extend the line to the next line?

e.g.
sql = "surname as text, firstname as text, initials as text

do I use
sql = "surname as text, /
firstname as text, /
initials as text"
or
sql = "surname as text, _
firstname as text, _
initials as text"

i.e. do I use "/" or "_" or what other character?
 

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

colin van Blommestein

Member
Licensed User
Longtime User
I'm creating a sql definition but run out of visible line space
What character do I use to extend the line to the next line?

e.g.
sql = "surname as text, firstname as text, initials as text

do I use
sql = "surname as text, /
firstname as text, /
initials as text"
or
sql = "surname as text, _
firstname as text, _
initials as text"

i.e. do I use "/" or "_" or what other character?
 
Upvote 0

colin van Blommestein

Member
Licensed User
Longtime User
I think the point has been missed!

I want to write one long line of code spread over two or more lines
How do I inform the code that my sing instruction extends over more than one line?
 
Upvote 0

Jorge M A

Well-Known Member
Licensed User
For me, the best aproach is use stringbuilder w/ append method, due there is no continuation line char, i guess.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
It's Space and underscore.

But the code below doesn't work. You cannot split a line in a string definition, the part between double quotes.
sql = "surname as text, _
firstname as text, _
initials as text"


In your case you could do this:
sql = "surname as text, "
sql = sql & "firstname as text, "
sql = sql & "initials as text"
 
Upvote 0

colin van Blommestein

Member
Licensed User
Longtime User
If (timothy = "a bunch of letters" and Jane = "just has too much information to fit into one line") or (creed = "is not happy that jane cannot fit this one statement over multiple lines because there is no character to split the code" then

John='i don't know what to do"

else

John="still can split the code across multiple lines without a string builder. But what happens if I'm not using strings only boolean logic?"

end if

The entire bold type code cannot be see in the IDE so I need a way to present it on multiple line as seen in this editor!
 
Upvote 0

colin van Blommestein

Member
Licensed User
Longtime User
It's Space and underscore.

But the code below doesn't work. You cannot split a line in a string definition, the part between double quotes.
sql = "surname as text, _
firstname as text, _
initials as text"


In your case you could do this:
sql = "surname as text, "
sql = sql & "firstname as text, "
sql = sql & "initials as text"
It's Space and underscore.

But the code below doesn't work. You cannot split a line in a string definition, the part between double quotes.
sql = "surname as text, _
firstname as text, _
initials as text"


In your case you could do this:
sql = "surname as text, "
sql = sql & "firstname as text, "
sql = sql & "initials as text"
 
Upvote 0

colin van Blommestein

Member
Licensed User
Longtime User

Thanks Klaus.
That is how I'm compiling the sql strings at the moment. Bit of a pain when many long sql statements need to be processed.
Would be nice to have an append character without multiple appends to a variable
 
Upvote 0
Top