Page 1 of 1

Gambas3 Code Layout

Posted: Wednesday 3rd January 2024 6:46pm
by an_other
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.

Re: Gambas3 Code Layout

Posted: Wednesday 3rd January 2024 7:07pm
by vuott
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"

Re: Gambas3 Code Layout

Posted: Thursday 4th January 2024 3:05am
by BruceSteers
You can just use multiple strings and they will be joined.

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


Re: Gambas3 Code Layout

Posted: Thursday 4th January 2024 9:46am
by thatbruce
Have you got the line wrap option set off in the ide?

Re: Gambas3 Code Layout

Posted: Friday 5th January 2024 5:56pm
by an_other
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