How can I lay a long line of code out on two or more lines? I need to declare several long strings, which run off the right side of the page. I am sure I have seen a way to do this, but can't find it now I need it.
Many thanks for any advice, An.
Gambas3 Code Layout
Re: Gambas3 Code Layout
If you refer to alphanumeric character strings, you can break the string into two or more parts, enclosed by quotation marks.
For convenience you can also have each one followed by the "&" symbol.
Exemplum:
Dim s as String
s = "aaaa bbbb cccc ddd " &
"eeee ffff gggg hhhh iiiiii"
For convenience you can also have each one followed by the "&" symbol.
Exemplum:
Dim s as String
s = "aaaa bbbb cccc ddd " &
"eeee ffff gggg hhhh iiiiii"
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
- BruceSteers
- Posts: 1607
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Gambas3 Code Layout
You can just use multiple strings and they will be joined.
Note, there is no linefeed between the strings and you CANNOT have a void line.
ie.
Dim s As String
s = "Some text, "
"Some more text"
Note, there is no linefeed between the strings and you CANNOT have a void line.
ie.
Dim s As String
s = "Some text, "
"Some more text"
' that will error because the blank line
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Gambas3 Code Layout
Have you got the line wrap option set off in the ide?
Have you ever noticed that software is never advertised using the adjective "spreadable".
Re: Gambas3 Code Layout
Thanks for the suggestions, guys - Somehow I had the idea that the second line was preceded by something like a backslash, but of course I entirely missed the obvious - thanks again