EndOfLine problems copied to Clipbard

Fellow coders

I’m trying to copy text from a text area into the clipboard.
The problem is that the text is always copied without the end of line. I tried multiple combinations with chr(13) and or EndofLine but all text is copied into a single line.

Pls find the project here (it’s very short)
https://www.dropbox.com/s/8fe8mjvsyhhe1e2/PQConverter.xojo_binary_project?dl=0

What am I doing wrong ?

Thanks
rgds

This works on OS X:

Dim c As New Clipboard c.SetText(TextArea1.Text) c.Close

Hope that helps.

Thanks Richard but the problem is still there

What application are you pasting to ?

Here, on Mac, I can paste in any standard application, endofline included.

To a simple text file, I’m on Windows btw.

edit:
I just noticed that If I paste it to Word the carriage returns are fine, but if I paste it to a txt file it’s all on a single line.
so it might be not relateed to Xojo ???

Try to post in the Windows channel next time. It is easier that way.

I tried, and indeed EndOfLine is not copied.

This is a bug worth reporting.

Here is the solution. TextArea Chr(13) internal line break is not Windows line ending which is chr(13)+chr(10). That is the reason why it did not work.

Dim c As New Clipboard c.SetText(ReplaceLineEndings(me.text,EndOfLine.Windows)) c.Close

Been that way a long time, and a bug - it should work without fiddles by platform.

[quote=191375:@Michel Bujardet]Try to post in the Windows channel next time. It is easier that way.
[/quote]

That’s Xojo for you - if you are not a Maccy-chap you’re a second-class citizen, relegated to a sub-forum.

[quote=191387:@Peter Job]Been that way a long time, and a bug - it should work without fiddles by platform.
That’s Xojo for you - if you are not a Maccy-chap you’re a second-class citizen, relegated to a sub-forum.[/quote]

Come on Peter. I know you like a good fight, but this is irrelevant. Most people who have Macs post in OS X. It is simply more convenient to reply when questions are in a platform channel that having to ask the ever repeated question : “Mac or Windows ?”.

… And I have never been the last one to fight for platform neutrality. Platform flames are more than idiotic, and go nowhere.

Fair enough mate. :wink:

( Peter winds his neck in and shuts up )

I checked in Feedback, this has not been reported before. So I did :

39558 - EndOfLine not copied to ClipBoard in Windows

OS: Windows 8/8.1/10

Xojo: Xojo 2015r2.2

Steps: When Clipboard is used on Windows to copy the content of a TextArea or portions of it that contain line breaks, thse are not copied, and the result pastes in Windows application without returns.

It seems to come from the fact that internally TextArea uses Chr(13) as line ending, when Windows Expects CR+LF.

This works around the issue, but it would be nice if it worked without

Dim c As New Clipboard
c.SetText(ReplaceLineEndings(me.text,EndOfLine.Windows))
c.Close

feedback://showreport?report_id=39558

Note that the problem has existed before in Mac, but has been fixed since : feedback://showreport?report_id=19887