Hi, I have a procedure like this:
procedure ConvertText; var b: Boolean; // turns bold on and off num: integer; // character-counter str: string; // string to be added to a string which will be put in RichEdit2 begin num := 0; b := False; repeat str := ''; RichEdit1.SelStart := num; RichEdit1.SelLength := 1; if (fsBold in RichEdit1.SelAttributes.Style) and not b then begin str := str + '[b]'; // if the text in RichEdit1 is bold, and the b switch is not b := True; // turned on yet, then a [b] will be added in front of the end; // converted text, and b will be set true RichEdit2.Text := str + RichEdit1.SelText; // copy the modification + text to RichEdit2 inc(num); // increase counter until num > CountNumChars(RichEdit1.Lines) // that procedure is mine, it's clear what it does end; So, i have a formatted text that I want to put to RichEdit2 (PlainText = TRUE). This procedure works fine, it puts [b] in front of the text that is bold and [/b] when it stops being bold, and generally it does everything it should except that it doesn't add line breaks. Perhaps it doesn't count the #13 in the Lines? Anyway, if I type something like this in RichEdit1: ----------- line one line two blahblah -------- I will get this in RichEdit2: ------- line oneline two blahblah ------ What should I do to correct this? Csaba --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/