TMemo's a line max chars=1024? lazarus / 31-LCL ---------------------------------------------------------------------- was · 2022-03-20 13:19 Problem: the saved content is inconsistent with the original content. TMemo's a line max chars =1024? (Run on Windows 10) Thanks. ---------------------------------------------------------------------- dseligo · 2022-03-20 13:52 Look at this thread: https://forum.lazarus.freepascal.org/index.php?topic=21496.0 If I remember correctly, this is some Windows limitation. Assuming you are on Windows, otherwise I don't know. In the thread I mentioned, SynEdit is proposed if you need longer lines. ---------------------------------------------------------------------- was · 2022-03-20 13:58 OK, Thank you for dseligo’s reply. ---------------------------------------------------------------------- wp · 2022-03-20 13:59 Your original text contains line breaks (#13#10) at offsets 1024, 2050, 3076, 3185. When the file is saved these line breaks are removed for some reason so that the written file is smaller by 4*2 = 8 bytes. Strangely enough, when I load the written file and save it again the line breaks are back. I rewrote your application for Delphi, and found that Delphi does not change the file size. Therefore, this is clearly a bug. Would you like to file a bug report? ---------------------------------------------------------------------- Josh · 2022-03-20 14:04 hi using laz and fpc trunk on win64, limitation does not occur. however an oddity in that the save file is larger ie 3187, tried using savetofile('filname.txt',false); to disable encoding but same size 3187 tried clearing the memo before loading still 3187 its adding a crlf after 1024 characters ie Standard component pallet and place it becomes Standard component pallet and pCRLF lace it ---------------------------------------------------------------------- was · 2022-03-20 14:18 Quote from: wp on March 20, 2022, 02:59:33 pmYour original text contains line breaks (#13#10) at offsets 1024, 2050, 3076, 3185. When the file is saved these line breaks are removed for some reason so that the written file is smaller by 4*2 = 8 bytes. Strangely enough, when I load the written file and save it again the line breaks are back. I rewrote your application for Delphi, and found that Delphi does not change the file size. Therefore, this is clearly a bug. Would you like to file a bug report? If it is a bug, Can you help me submit a bug report? I'm a beginner.  Thanks a lot. ---------------------------------------------------------------------- dseligo · 2022-03-20 14:24 Quote from: was on March 20, 2022, 03:18:52 pmCan you help me submit a bug report? I'm a beginner.  https://wiki.freepascal.org/How_do_I_create_a_bug_report ---------------------------------------------------------------------- wp · 2022-03-20 15:53 Quote from: wp on March 20, 2022, 02:59:33 pmYour original text contains line breaks (#13#10) at offsets 1024, 2050, 3076, 3185. When the file is saved these line breaks are removed for some reason so that the written file is smaller by 4*2 = 8 bytes. Strangely enough, when I load the written file and save it again the line breaks are back. I rewrote your application for Delphi, and found that Delphi does not change the file size. Therefore, this is clearly a bug. Would you like to file a bug report? Trying to further investigate, I suddenly notice that now 'test.txt' and 'test0.txt' have the same size. What is going on here? What did I change? Tested back to Laz 1.8.4 / FPC 3.0.4 - all ok now... ---------------------------------------------------------------------- Thaddy · 2022-03-20 15:53 Yes, it can, but in that case there should be a soft linebreak (#13#13#10) instead of a hard linebreak (#13#10). Also note it is Windows only. Other widget sets and possibly Win64 do not suffer from this. I can't test Win32: never use it and am not going to.