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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X