rgreat Posted January 13, 2016 Share Posted January 13, 2016 Screenshot attached. procedure TProgressDlg.AddToLog(Text: string); begin Memo1.Lines.Add(Text); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 13, 2016 Share Posted January 13, 2016 Hi, Â Well, as you know, this is "default behavior" of "Memo VCL", this line will be ignored when called "Count" If you delete a "line break", the behavior UniMemo1.Lines.Add will be different, the text will be added to the end of the line... Â Best regards. Quote Link to comment Share on other sites More sharing options...
rgreat Posted January 13, 2016 Author Share Posted January 13, 2016 Ok, i used workaround... procedure TProgressDlg.AddToLog(Text: string); begin Memo1.Lines.Insert(0,Text); end; Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted September 10, 2021 Share Posted September 10, 2021 any solution? Â Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 10, 2021 Share Posted September 10, 2021 11 minutes ago, Daha Software said: Â On 1/13/2016 at 8:58 PM, Sherzod said: Well, as you know, this is "default behavior" of "Memo VCL", this line will be ignored when called "Count" If you delete a "line break", the behavior UniMemo1.Lines.Add will be different, the text will be added to the end of the line... Â On 1/13/2016 at 10:47 PM, rgreat said: Ok, i used workaround... procedure TProgressDlg.AddToLog(Text: string); begin Memo1.Lines.Insert(0,Text); end; Â Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted September 10, 2021 Share Posted September 10, 2021 Not work! When I insert a new line, in the memo it adds a blank ending line. Â Problem is that when writing to the database, it is always writing this blank line Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 10, 2021 Share Posted September 10, 2021 4 minutes ago, Daha Software said: Problem is that when writing to the database, it is always writing this blank line Are you using UniMemo or UniDBMemo? Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted September 10, 2021 Share Posted September 10, 2021 UniMemo , but UniMainModule.IBQCFEOBS.Text:=UniMemo4.Lines.Text  But it happens with both components. If I use DBMEMO without any blank ending lines and save to the database, it adds a blank ending line Quote Link to comment Share on other sites More sharing options...
rgreat Posted September 10, 2021 Author Share Posted September 10, 2021 TrimRight(UniMemo4.Lines.Text) ? 😅 1 1 Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted September 10, 2021 Share Posted September 10, 2021 Perfect...  Remove spaces at the beginning and end of text (including blank lines): UniMainModule.IBQCFEOBS.Value:= TrimLeft(TrimRight(UniMemo4.Lines.Text)); --------- TMEMOFIELD use:  UniMainModule.IBQPROTOCOLOLINHAS.AsString:= TrimLeft(TrimRight(IBQPROTOCOLOLINHAS.AsString));  1 Quote Link to comment Share on other sites More sharing options...
rgreat Posted September 12, 2021 Author Share Posted September 12, 2021 On 9/10/2021 at 7:39 PM, Daha Software said: TrimLeft(TrimRight(UniMemo4.Lines.Text)); 1. This is equal to Trim(UniMemo4.Lines.Text) 2. TrimLeft is unsafe. It will remove leading spaces in the first line, for example. That's why I only used TrimRight instead of Trim. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.