Ticket #36506

Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

New lines not created by #13#10

Open Date: 2016-08-01 19:00 Last Update: 2017-06-03 22:41

Reporter: (Anonymous) Owner: (None)
Type: Bugs Status: Open
Component: (None) MileStone: (None)
Priority: 5 - Medium Severity: 5 - Medium
Resolution: None

Details

According to chapter "About new line characters" in appendix of the help file, the newline is created by #13#10 (assuming I'm on windows machine). as i want a proper logfile that is readably by humans, i intend to give some extra output to the screen and therefore to the logging file.

But newlines are acheived neither by adding #13#10 nor adding 13 10 to the dispstr command, instead those characters are completely omitted. if more #10 are added, it seems to work for the first "#13#10#10" sequence. pelase see code below for example

This happens in TT 4.89 and 4.91.

  1. intdim baudrates 15 ;define array
  2. baudrates[0] = 921600
  3. baudrates[1] = 460800
  4. baudrates[2] = 230400
  5. baudrates[3] = 115200
  6. ...
  7. ;turn on logging for file examination
  8. for baud 0 14
  9. if baudrates[baud]<>0 then
  10. setbaud baudrates[baud]
  11. ;display current baud test on screen
  12. int2str sBaud baudrates[baud]
  13. dispstr '+++ ... testing baud= ' sBaud #13#10 ;ERROR gives no newline-characters
  14. dispstr '+++ ... testing baud= ' sBaud #13#10#13#10 ;ERROR gives no newline-characters
  15. dispstr '+++ ... testing baud= ' sBaud #13#10#10 ;gives: CR+LF
  16. dispstr '+++ ... testing baud= ' sBaud #13#10#10#10 ;gives: CR+LF+LF
  17. mpause 250
  18. flushrecv
  19. mpause 100
  20. sendln 'cmd'
  21. wait 'response1'
  22. mpause 250
  23. if result > 0 then
  24. goto ConnectionEstablished
  25. endif
  26. endif
  27. next

Attachment File List

No attachments

Ticket History (3/10 Histories)

2016-08-01 19:00 Updated by: None
  • New Ticket "New lines not created by #13#10" created
2016-08-18 18:33 Updated by: yutakapon
  • Priority Update from 7 to 5 - Medium
2016-08-22 21:07 Updated by: maya
2016-12-01 09:01 Updated by: None
2016-12-06 21:45 Updated by: maya
2017-03-01 09:01 Updated by: None
2017-03-14 19:57 Updated by: maya
2017-06-01 09:01 Updated by: None
2017-06-03 22:41 Updated by: maya
2017-09-23 15:06 Updated by: None
Comment

I think the order matters. The following works for me on TTerm 4.96. Cheers, fwj

CRLF = #10#13
CRLFLF = #10#10#13

dispstr '========' CRLF
dispstr 'Line 1' CRLF           ;expect no blank above; no blank below
dispstr 'Line 2' CRLFLF         ;expect no blank above; a blank below
dispstr 'Line 3' CRLF           ;expect a blank above; a blank below
dispstr CRLF   'Line 4' CRLF    ;expect a blank above; no blank below
dispstr        'Line 5' CRLFLF  ;expect no blanks above; 2 blanks below
dispstr CRLF   'Line 6' CRLFLF  ;expect 2 blanks above; 3 blanks below
dispstr CRLFLF 'Line 7' CRLFLF  ;expect 3 blanks above; a blank below
dispstr '========' CRLF

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login