チケット #36506

New lines not created by #13#10

登録: 2016-08-01 19:00 最終更新: 2017-06-03 22:41

報告者:
(匿名)
担当者:
(未割り当て)
チケットの種類:
状況:
オープン
コンポーネント:
(未割り当て)
マイルストーン:
(未割り当て)
優先度:
5 - 中
重要度:
5 - 中
解決法:
なし
ファイル:
なし
投票
点数: 0
No votes
0.0% (0/0)
0.0% (0/0)

詳細

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

チケットの履歴 (10 件中 3 件表示)

2016-08-01 19:00 更新者: None
  • 新しいチケット "New lines not created by #13#10" が作成されました
2016-08-18 18:33 更新者: (del#24082)
  • 優先度7 から 5 - 中 に更新されました
2016-08-22 21:07 更新者: (del#1144)
2016-12-01 09:01 更新者: None
2016-12-06 21:45 更新者: (del#1144)
2017-03-01 09:01 更新者: None
2017-03-14 19:57 更新者: (del#1144)
2017-06-01 09:01 更新者: None
2017-06-03 22:41 更新者: (del#1144)
2017-09-23 15:06 更新者: None
コメント

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

添付ファイルリスト

添付ファイルはありません

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする