Thank you for your quick reply. As I said, it is a luxury problem.I have played with this as well. Looking at how the code is parsed, I am pretty sure that there is no continuation character.
If you are using a TextArea to edit the code, turn on WordWrap.
It crossed my mind that it would be useful to be able to add comments to the bbcode text, but haven't got around to adding a wish yet.it is only used for a more detailed explanation
It crossed my mind that it would be useful to be able to add comments to the bbcode text, but haven't got around to adding a wish yet.
Dim Part1, Part2, Part3 As String
Part1 = $"[Alignment=Center][TextSize=20][b][u]This is the title "$ '--- title text
Part2 = $"$[FontAwesome=0xF034/] [FontAwesome=0xF035/][/u][/b][/TextSize][/Alignment]"$ ' --- Other text font
Part3 = $"Emoji made of multiple "characters": ?? And a flag: [TextSize=30][e=??/][/TextSize]"$ ' --- Let show emoji
CodeView1.Text = $"${Part1}${Part2}${Part3}"$ ' --- And combine to one-liner
Unless the entire text is static, I combine dynamic program-generated text into a more descriptive variable name that also allows me to omit the comments. But indeed convenience comes at a price in terms of memory usage.But the approach is good. I already do something similar by "adding" the string line by line... The problem is simply that a lot of space is then lost again for the "string addition".
Program = $"[TextSize=18]${CRLF}${B4JCRLF}[/TextSize][Alignment=Center][url]${GetAppTS} .....
${TS}[b]${B4JCRLF}${DCCodeMod.FormFtrClrStr}Blah Blah Blah 1[/color][/b][/TextSize]"$
Program = $"${Program}
${TS2}Copyright ©${DateTime.GetYear(DateTime.Now)} Blah Blah..."$
#If not(B4J)
If SC < 6 Then
Program = $"${CRLF}${Program}"$
End If
#End If
AboutCV.Text = Program
I use a variable and when the line gets too long I close it and start again.
Dim content As String
content = $"${content}[Alignment=Center][TextSize=20][b][u]This is the title "$ '--- title text
content = $"${content}[FontAwesome=0xF034/] [FontAwesome=0xF035/][/u][/b][/TextSize][/Alignment]"$ '--- Other text font
content = $"${content}Emoji made of multiple "characters": ?? And a flag: [TextSize=30][e=??/][/TextSize]"$ '--- Let show emoji
Log(content)
Dim content As StringBuilder: content.Initialize
content.Append($"[Alignment=Center][TextSize=20][b][u]This is the title "$) '--- title text
content.Append($"[FontAwesome=0xF034/] [FontAwesome=0xF035/][/u][/b][/TextSize][/Alignment]"$) '--- Other text font
content.Append($"Emoji made of multiple "characters": ?? And a flag: [TextSize=30][e=??/][/TextSize]"$) '--- Let show emoji
Log(content.toString)
Dim P as string
P = $"klajshf aer;oh aer;oi aew;foi oijaef[iaer[ifo oijaewferg aerfaef.
"$
P = $"${P};iojare a;ioer ea;oiaeroijalk.areergerh;lkjsd...af
"$
P = $"${P}Etc. Etc.....
Dim content As String = _
$"[Alignment=Center][TextSize=20][b][u]This is the title "$ & _ '--- title text
$"[FontAwesome=0xF034/] [FontAwesome=0xF035/][/u][/b][/TextSize][/Alignment]"$ & _ '--- Other text font
$"Emoji made of multiple "characters": ?? And a flag: [TextSize=30][e=??/][/TextSize]"$ '--- Let show emoji
Log(content)
I don't believe your code will put in any carriage returns. What you have is all on one line. Mine will be on 4 lines (one blank) Also, @Erel thinks using string literals ($""$) is extremely important. I don't understand why but he is a lot smarter than me at this stuff so I will run with it.?Why not just
B4X:Dim s As String s = "jjhjhkjjhkjhkjhkjhkjhkjhkjhkjhkjhkjhkjhkjhkhkjhkj" & _ "iuoiuoiuiuoiuoioiuoiuoiuoiuoiuoiuoiuoiuoiuoiuoiuoiuoi" & _ "vbvbvbvbvbvbvbvbvbvbvbvbvbbvbvbvbvbvbbvbvbvbvbvbvbbvv" Log(s)
Works with $"..."$ too
I don't believe your code will put in any carriage returns
Dim content As String = _
$"[Alignment=Center][TextSize=20][b][u]This is the title "$ & _ '--- title text
$"[FontAwesome=0xF034/] [FontAwesome=0xF035/][/u][/b][/TextSize][/Alignment]"$ & _ '--- Other text font
$"
"$ & _
$"Emoji made of multiple "characters": ?? And a flag: [TextSize=30][e=??/][/TextSize]"$ '--- Let show emoji
Log(content)
In your example theHow about adding ${CRLF} or to show the paragraphs more clearly:
B4X:Dim content As String = _ $"[Alignment=Center][TextSize=20][b][u]This is the title "$ & _ '--- title text $"[FontAwesome=0xF034/] [FontAwesome=0xF035/][/u][/b][/TextSize][/Alignment]"$ & _ '--- Other text font $" "$ & _ $"Emoji made of multiple "characters": ?? And a flag: [TextSize=30][e=??/][/TextSize]"$ '--- Let show emoji Log(content)
"$ & _
$"
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?