Recent

Author Topic: [SOLVED]Lazarus trunk: why the carriage character is displayed  (Read 2466 times)

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
[SOLVED]Lazarus trunk: why the carriage character is displayed
« on: November 02, 2017, 09:59:42 pm »
Hi friends

There is many line text in Memo. I transfer the text to Edit

Code: Pascal  [Select][+][-]
  1. Edit1.Text:= Memo1.Text;

In Windows the text is displayed correctly, but in Linux in the text caret symbols are visible (see attach).

It is necessary for me that the newline character remained by transmission of the text from Edit in Memo.

Code: Pascal  [Select][+][-]
  1. Memo1.Text:= Edit1.Text;

How it is possible to fix this problem?
« Last Edit: November 09, 2017, 09:33:13 pm by zoltanleo »
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: Lazarus trunk: why the carriage character is displayed
« Reply #1 on: November 02, 2017, 10:00:12 pm »
project archive
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: Lazarus trunk: why the carriage character is displayed
« Reply #2 on: November 04, 2017, 02:04:33 pm »
Friends, tell me, please. Is there an IDE bug or I'm doing something wrong?
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Lazarus trunk: why the carriage character is displayed
« Reply #3 on: November 04, 2017, 02:53:20 pm »
First of all I am a Windows person.

I think there is a logical error in the idea of moving text between TMemo and TEdit. Consider when the user changes the text in the edit for instance.

Showing a box with the hex value of a character that does not have a glyph representation seems a Linux concept. I am familiar with it through Firefox. While Windows usually shows an empty box.

It seems there is also another difference. Linux shows line ending in a single line edit. While Windows does not. This explains the images you attached in your first post. Line ending in Linux is #$0A, while in Windows gets two bytes #$0D#$0A.

This also makes it clear if you were to save the data and move it between Linux and Windows you'll have a problem with different line endings. Prepare for it.

I don't think there is a bug in the IDE. Not in this case.

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: [SOLVED]Lazarus trunk: why the carriage character is displayed
« Reply #4 on: November 09, 2017, 09:35:19 pm »
This code allows to achieve the necessary result
Code: Pascal  [Select][+][-]
  1. Edit1.Text := StringReplace(Memo1.Text, #10, #13, [rfReplaceAll]);
It is surprising, but it works!  :)
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

 

TinyPortal © 2005-2018