Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Daiim on May 16, 2022, 07:31:50 pm
-
Hi there,
I try to set the text to an element notes property, but the "\n" linebreaks within the strings are simply ignored. Does anyone know how to do a linebreak? (More formatting tipps are welcome, too.)
That does not work as \n are ignored :/
var someElement as EA.Element;
someElement.Notes = "First text line.\nSecond text line.";
Thank you guys for helping me out!
Daiim
-
What language?
In your example you are using "\t", not "\n"
Geert
-
What language?
In your example you are using "\t", not "\n"
Geert
Thank you for that hint - fixed it in the post.
I'm using JScript.
-
this might help: https://stackoverflow.com/a/36527267/2018133 (https://stackoverflow.com/a/36527267/2018133)
Geert
-
Thanks, Geert for your hint - close but simplier as I tried another apporach and read formatted text from notes. It points out, that it is html:
<u>And</u> a new Line. <a href="$inet://www.heise.de"><font color="#0000ff"><u>Links</u></font></a> are also possible.
Sorrowly there are no newlines shown, but after playing around - no, it is not html, it is necessary to use a '\r\n' (carriage return + newline). Works fine now.