Newline character?

Former Member
Former Member
Is there a newline character?

To be more precise: I want to use a localized string in a confirmation dialog and it's to long for a single line. Is it possible to split this into 2 lines without making a custom confirmation dialog?
  • Former Member
    Former Member over 10 years ago
    Try adding this to your string for a new line:

    "\r\n"
  • Former Member
    Former Member over 10 years ago
    I did. That didn't work. I got two diamonds (as in a card game).
  • Did you try just \n? I'm guessing that won't work since \r\n didn't work. We can investigate making the confirmation dialog accept \n if it doesn't work.
  • Former Member
    Former Member over 10 years ago
    No that didn't work either.

    For a normal dc.drawText it does work with \n, but only if you put in a string literal, not when you have an attribute or variable, it seems. So I think the actual problem is not with the confirmation dialog, I think.
  • No that didn't work either.

    For a normal dc.drawText it does work with \n, but only if you put in a string literal, not when you have an attribute or variable, it seems. So I think the actual problem is not with the confirmation dialog, I think.


    It works fine for me when working on a string...

    i.e.: dateStr = Lang.format("$1$ \n$2$", [info.month, info.day]);
  • I've entered a ticket to investigate making the confirmation dialog support multiple lines.
  • Former Member
    Former Member over 10 years ago
    It works fine for me when working on a string...

    i.e.: dateStr = Lang.format("$1$ \n$2$", [info.month, info.day]);


    Thanks, that works.

    I do still think that all of these should get the same result. That's what that ticket should be about.

    dc.drawText(x, y, font, "connect\niq", just);
    var text = "connect\niq";
    dc.drawText(x, y, font, "connect\niq", just);
    var c = "connect";
    var d = "iq";
    dc.drawText(x, y, font, Lang.format("$1$\n$2$", [c, d]), just);