Author Topic: EA.Element.Notes linebreak?  (Read 2232 times)

Daiim

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
EA.Element.Notes linebreak?
« 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 :/
Code: [Select]
var someElement as EA.Element;
someElement.Notes = "First text line.\nSecond text line.";

Thank you guys for helping me out!

Daiim
« Last Edit: May 16, 2022, 07:41:47 pm by Daiim »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA.Element.Notes linebreak?
« Reply #1 on: May 16, 2022, 07:39:40 pm »
What language?

In your example you are using "\t", not "\n"

Geert

Daiim

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: EA.Element.Notes linebreak?
« Reply #2 on: May 16, 2022, 07:42:32 pm »
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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA.Element.Notes linebreak?
« Reply #3 on: May 16, 2022, 07:53:37 pm »

Daiim

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: EA.Element.Notes linebreak?
« Reply #4 on: May 16, 2022, 08:40:06 pm »
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:
Quote
<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.
« Last Edit: May 16, 2022, 08:42:35 pm by Daiim »