Multiline strings

Post your Gambas programming questions here.
Post Reply
basica
Posts: 2
Joined: Wednesday 24th June 2020 2:23pm

Multiline strings

Post by basica »

I did a quick google search and I found and old mailing list thread that seems to indicate it wasn't possible at the time (back in 2013) but I was wondering whether there's a straightforward way to doing it now?
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Multiline strings

Post by cogier »

Hi and welcome to the forum.

You can do multiline strings, here are a couple of examples: -
Dim sString As String[] = ["I did a quick google search and I found and old mailing list thread that seems to indicate it wasn't possible at the time (back in 2013)",
    "but I was wondering whether there's a straightforward way to doing it now?"]

Dim sS As String = "I did a quick google search and I found and old mailing list thread" &
    " that seems to indicate it wasn't possible at the time (back in 2013)" &
    "but I was wondering whether there's a straightforward way to doing it now?"
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Multiline strings

Post by stevedee »

...and you can naturally do stuff like this:-
Public Sub Button1_Click()
Dim CatStevens As String

  CatStevens = "It's not time to make a change" & gb.CrLf &
  "Just relax, take it easy" & gb.CrLf &
  "You're still young, that's your fault" & gb.CrLf &
  "There's so much you have to know" & gb.CrLf

  TextArea1.Text = CatStevens
  

End
basica
Posts: 2
Joined: Wednesday 24th June 2020 2:23pm

Re: Multiline strings

Post by basica »

Cheers guys. Appreciate the responses.
Post Reply