Strange square characters at end of TDBMemo? lazarus / 16-Databases ---------------------------------------------------------------------- bill0287 · 2013-12-13 18:54 I have a TDBMemo tied to a TMemoField in a TDBF. At the end of the memo are two square characters. I can delete them, post the data, but they always come back.  Is there something I can do to prevent this? Lazarus 1.0.14 FPC 2.6.2 SVN 43446 Win32 XP ---------------------------------------------------------------------- mica · 2013-12-13 19:40 Lazarus version? OS? Looks like an Unicode/ANSI/whatever encoding problem ---------------------------------------------------------------------- bill0287 · 2013-12-13 19:57 added above ---------------------------------------------------------------------- engkin · 2013-12-13 22:01 Why don't you try to see what their values are? I guess it is a LineEnding. If I'm correct you should get #13#10. ---------------------------------------------------------------------- bill0287 · 2013-12-13 22:08 Unfortunately, I don't know how to do that. I just start typing in the DBMemo, post it, and then when I return to the record, there they are. It's even worse than I thought. I do the same thing in another record's DBMemo, and that text new appends in some of the other records too.  I have no coding in this form...I am just connecting up Data Aware components. I attached a simple test that shows DBMemo is all over the place in this case. ---------------------------------------------------------------------- engkin · 2013-12-13 22:26 TDBMemo is a descendent of TCustomMemo, meaning that it has both Lines and Text: Assuming you have a TButton named Button1 and a TDBMemo named DBMemo1. Use the following code: Code: [Select]function GetMeLastTwoChars(SomeStr: String): String; var   L: Integer; begin   L := Length(SomeStr);   if L>1 then     Result := Format('#%d, #%d',[Ord(SomeStr[L-1]), Ord(SomeStr[L])])   else     Result := 'Less than two chars!'; end; procedure TMainForm.Button1Click(Sender: TObject); begin   ShowMessage('Text: ' + GetMeLastTwoChars(DBMemo1.Text));   ShowMessage('Line[0]: ' + GetMeLastTwoChars(DBMemo1.Lines[0])); end; ---------------------------------------------------------------------- bill0287 · 2013-12-14 03:29 If I did this right I got back this: Text: #32,#32 Line[0]:#32,#32 ---------------------------------------------------------------------- engkin · 2013-12-14 04:14 I did not notice that you had attached a sample project. I tried it and did not see the problem. I'm using Lazarus 1.1, Rev: 41139 with FPC 2.7.1 My opinion it's a bug that got solved added. ---------------------------------------------------------------------- Leledumbo · 2013-12-14 06:43 I used to have this "issue" in my college's lab 5-6 years ago which I can't reproduce in my desktop at home. It also only happens on several computers, not all. Since the lab maintainer upgraded the OS to Win 7, it no longer appears. I think it's related to certain Windows configuration that displays space characters instead of hiding it. ---------------------------------------------------------------------- bill0287 · 2013-12-14 22:34 FYI. I tested with Level IV DBf tables and the errors were gone. It seems to be related to level III tables. ---------------------------------------------------------------------- engkin · 2013-12-14 23:10 Thanks for letting us know. I was digging in the source code trying to figure out possible reasons. ---------------------------------------------------------------------- BigChimp · 2013-12-15 03:04 Quote from: bill0287 on December 14, 2013, 11:34:19 pmFYI. I tested with Level IV DBf tables and the errors were gone. It seems to be related to level III tables. FYI, Bill raised bug report http://bugs.freepascal.org/view.php?id=25422 As he indicated, the issue is DBase III specific but is solved in FPC fixes 2.6, and FPC trunk/2.7.1.