Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print() ignores \n

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Print() ignores \n

    I just found out that newlines are ignored by Print(), i.e.

    Print("Line1\nLine2");

    yields

    Line1Line2

    and not

    Line1
    Line2

    Maybe that's how Print() is supposed to behave but that'd certainly be weird.

    #2
    Check out this thread
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      Thanks mrlogik for pointing this out to me!

      So Print("Line1\r\nLine2"); works.

      However, I think this behaviour should be changed as using just "\n" is the more common way.

      My problem is that I am forwarding strings from other components to the output window, so I have to manually replace every "\n" with "\r\n" before sending them to Print().

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      176 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      331 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      254 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      356 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      184 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X