Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 11 to 16 of 16 total |
MultiEdit Line Count |
Fri, Mar 16 2018 4:26 PM | Permanent Link |
erickengelke | Coullie wrote:
Walter Matte wrote: <You mean: MultiLineEdit1.lines.count - 1> :Yup sorry Walter. My question is still the same. Why no line count. You're so close... I would recommend setting MultiLineEdit1.LineSeparator = #10 probably before you read in the text. Then after reading the text, the count should be what you expect because you and EWB will be agreeing on using #10 as the end of line separator. Erick http://www.erickengelke.com |
Fri, Mar 16 2018 9:03 PM | Permanent Link |
Raul Team Elevate | On 3/15/2018 5:55 PM, Coullie wrote:
> all split my text into lines. my problem is the line count of the multiedit > Ive attached a png showing the result of the following code > This indicates to me that my string is correctly split into lines but the line count is still 1 I just tried it here and multiedit works fine if you set the LineSeparator : For test i used a button press event and did this : me.Lines.Clear; me.Lines.LineSeparator := #10; me.Text := 'a' + #10 + 'b' + #10 + 'c' + #10 + 'd' + #10 + 'e' + #10 + 'f'; ShowMessage(' Line Count = ' + inttostr(me.Lines.Count)); The message dialog shows "Line Count = 6" and actual display output looks like this a b c d e f Raul |
Sun, Mar 18 2018 10:08 PM | Permanent Link |
Coullie | Raul wrote:
<For test i used a button press event and did this : me.Lines.Clear; me.Lines.LineSeparator := #10; me.Text := 'a' + #10 + 'b' + #10 + 'c' + #10 + 'd' + #10 + 'e' + #10 + 'f'; ShowMessage(' Line Count = ' + inttostr(me.Lines.Count));> Yup that works I think im getting closer. My server (mormot server) is sending #10. The string is being received in EWB as \n I get line separation but my ShowMessage shows 1. with only 1 message If imake me.Lines.LineSeparator := '\n' it doesnt work I just have to work out where the translation from #10 to \n is taking place |
Sun, Mar 18 2018 11:04 PM | Permanent Link |
Raul Team Elevate | On 3/18/2018 10:08 PM, Coullie wrote:
> I think im getting closer. My server (mormot server) is sending #10. > The string is being received in EWB as \n This looks like mormot issue to me,. I'm no expert but i've really only seen \n as newline in c/c++. > I get line separation but my ShowMessage shows 1. with only 1 message > If imake me.Lines.LineSeparator := '\n' it doesnt work LineSeparator is declared as string and as per help "Specifies the character, or characters, to use to separate multiple strings into the list of strings when assigning a string value to the Text property". I tried it and yes, there seems to be a bug with the memo. if i do this MultiLineEditOutput.Lines.LineSeparator := '\n'; MultiLineEditOutput.Text := 'a\nb\nc\nd\ne\nf\ng'; Then it's all shown on a single line but line count itself is reported correct though. in your case i'd still suggest tracking down why the \n shows up though as that likely will simply cause you other problems later as well. > I just have to work out where the translation from #10 to \n is taking place You can use browser debug tools to see what the raw data actually looks like - F12 in most browsers and then network tab or imilar can be used to see requests/responses with full headers and data. Raul |
Sun, Mar 18 2018 11:36 PM | Permanent Link |
Coullie | Raul wrote:
<This looks like mormot issue to me,. I'm no expert but i've really only seen \n as newline in c/c++.> Thanks Raul and all who advised, found the problem in a parsing function so as not to break other code using this function I did: StrReplace(S, '\n', #10, true, false); now I get a line count. |
Tue, Mar 20 2018 5:22 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Coullie,
<< I think im getting closer. My server (mormot server) is sending #10. The string is being received in EWB as \n I get line separation but my ShowMessage shows 1. with only 1 message If imake me.Lines.LineSeparator := '\n' it doesnt work >> Don't use the JS special strings for line feeds - they can be interpreted differently depending upon the browser engine in use: https://stackoverflow.com/questions/10887011/javascript-preformatted-text-with-cross-browser-line-breaks That's why EWB uses specific code points for such characters when dealing with JSON, etc. Tim Young Elevate Software www.elevatesoft.com |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Wednesday, October 9, 2024 at 05:37 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |