Multiline strings

Post Reply
burque505
Posts: 10
Joined: Fri Mar 25, 2022 4:31 pm

Multiline strings

Post by burque505 »

How can I create a multiline string in BasicMaker?
Thanks in advance.
SuperTech
SoftMaker Team
SoftMaker Team
Posts: 3196
Joined: Wed Mar 11, 2020 5:31 pm

Re: Multiline strings

Post by SuperTech »

Please check our BasicMaker manual for guidance on data types.
burque505
Posts: 10
Joined: Fri Mar 25, 2022 4:31 pm

Re: Multiline strings

Post by burque505 »

My apologies, but that doesn't answer my question. Here's an example of a multiline string:

"I am a string that contains carriage returns.

As you can see, I also contain more than one paragraph.

I also contain special characters like %, \, /, $ and @.

Everything from the first double quote to the closing double quote is part of the multiline string.

String ends after the double quote ... "

Strings with carriage returns and special characters are supported to various degrees in all serious programming languages.

I want to create a variable for BasicMaker that contains a multiline string.

Thank you.
burque505
Posts: 10
Joined: Fri Mar 25, 2022 4:31 pm

Re: Multiline strings

Post by burque505 »

I have discovered a reasonable workaround for BasicMaker multiline strings.

Code: Select all

Sub Main
Dim lStr$
lStr$ = ""

lStr$ = lStr$ & "This is a long block of text that I want to fill "
lStr$ = lStr$ & "into a form field. I need to make sure I pay attention "
lStr$ = lStr$ & "to spacing and carriage return issues while doing so. "
lStr$ = lStr$ & "I also have to use quotes liberally, the concatenation "
lStr$ = lStr$ & "operator, and the continuance underscore to make sure "
lStr$ = lStr$ & "BasicMaker can parse my code." & Chr(10) & Chr(13)
lStr$ = lStr$ & "It's kind of a pain" & Chr(10) & Chr(13) & "and I wish I could use "
lStr$ = lStr$ & "a heredoc instead, letting me copy and paste the block"
lStr$ = lStr$ & "of text I need from another source and shove it into "
lStr$ = lStr$ & "a string."

MsgBox lStr$
End Sub
Post Reply

Return to “BasicMaker 2021 for Windows”