Thanks Jean-Yves! That brought me a step further. But the following still invokes the beach ball at line 7:
TextArea1.StyledText.RTFData = "{\rtf1\ansi\ansicpg1252{\fonttbl{\f0\fnil .AppleSystemUIFont;}}{\colortbl\red0\green0\blue0;}\uc0 \f0\fs26}"
for rCount=0 to 10
TextArea1.addText("line_"+rCount.toString)
next
system.DebugLog "TextArea1 = "+TextArea1.StyledText.RTFData
system.DebugLog "TextArea1 = "+TextArea1.Text
```works, but does not output the RTF-Info
I think I got it! First I assemble the string in a variable string, then I hand it over in one piece to TextArea1. Like you mentioned just above.
var ST as String
ST = "{\rtf1\ansi\ansicpg1252{\fonttbl{\f0\fnil .AppleSystemUIFont;}}{\colortbl\red0\green0\blue0;}\uc0 \f0\fs26"
for rCount as integer=0 to 10
ST = ST + "Line_"+rCount
next
ST = ST+"}"
TextArea1.StyledText.RTFData = ST
The only thing now is, that in the textArea, the font size is about one letter per width of TextArea1ā¦ but that is easy to fix
TextArea1.FontSize = 14
BUT! No I have a problem with the Encoding of the text in TextArea1. The EndOfLine is shown by a sign like this: ļæ½
Any ideas how to fix that?
Thanks Emile. How do I check, what encoding the TextArea is? And ANSI is not an option with DefineEncodingā¦ Maybe I am mixing here something up?
ā I correct myself: TextArea1.StyledText.RTFData = ST.DefineEncoding(Encodings.WindowsANSI) does not bring the solution. Still no line break displayed.
TextArea1.StyledText.RTFData = "{\rtf1\ansi\ansicpg1252{\fonttbl{\f0\fnil .AppleSystemUIFont;}}{\colortbl\red0\green0\blue0;}\uc0 \f0\fs26}"
for rCount=0 to 10
TextArea1.addText("line_"+rCount+EndOfLine+EndOfLine)
next
Then the encoding issue is gone. Thanks everyone for the help.
Are-you aware that your RTF document have ansi as encoding ?
Also, the code you share is incomplete; and it cannot be run.
Example of error:
Window1.PushButton1.Action, line 6
Parameter ātextā expects type String, but this is type No Type.
TextArea1.addText(āline_ā+rCount+EndOfLine+EndOfLine)