EndOfLine not working on a Mac

I used a simple string, e.g. string = “some text” + EndOfLine + “some text”
but it did no carriage return.
EndOfLine.Macintosh does not work either.
where is the problem ?

Johann

Maybe your problem is related to this change:

EndOfLine.Unix does not work either.

How are you determining that EndOfLine is not working? What is your code?

It certainly appears to be working here. This code displays the text on two lines in a TextArea, for example:

TextArea1.Text = "Hello" + EndOfLine + "World"

[quote=81248:@Johann JFK]I used a simple string, e.g. string = “some text” + EndOfLine + “some text”
but it did no carriage return.
EndOfLine.Macintosh does not work either.[/quote]

Both versions do work in that they create two lines of text, i.e. they do insert a valid end-of-line character. That character isn’t carriage return (ASCII 13), though, as the end-of-line character is linefeed (ASCII 10).

I put it in a MessageDialog and it does not do a carriage return.

That’s not indicative of it not working
MessageDialog may actually NOT support multiline messages

MsgBox may be a better choice here.

What platform? On a Mac, the code below gives me two lines:

  dim dlg as new MessageDialog
  dlg.Message = "this" + EndOfLine + "that"
  call dlg.ShowModal

and on OSX this gives me 3 lines

msgbox "line 1"+EndOfLine+"line2"+EndOfLine+"line3"

With the same code as Kem :

I’m passing the concatenated string to a function which displays a MessageDialog with this message,
this does not display the message in different lines, maybe I have to restructure my function.

thanks to all

I did some testing.
it works with static text strings but as soon as I add a variable to the string, the EndOfLine does not work.

post an example

  dim a as string="line1"
  dim b as string="line2"
  dim c as string="Line3"
  msgbox a+EndOfLine+b+EndOfLine+c

still works as advertised…

are you seeing a black diamond with a ? in it?
If so, the encoding of your passed string is not correct.

yes, I get a black diamond with a ?,
how can I correct it ?

Post your actual code please.

this is my code:

dlg.Message = “Delete selected customer type ?” + EndOfLine + EndOfLine + _
"CustomerType: " + invThis.type + " " + EndOfLine + _
"Customer name: "
b = dlg.ShowModalWithin(self)

the variables invThis.type is a string.

Try this:

dim msg as string =  "Delete selected customer type ?" + EndOfLine + EndOfLine + _
"CustomerType: " + invThis.type + " " + EndOfLine + _
"Customer name: " 
msg = msg.ConvertEncoding( Encodings.UTF8 )
dlg.Message = msg
…

If that doesn’t work, change “ConvertEncoding” to “DefineEncoding” and try again.

Try

dlg.Message = “Delete selected customer type ?” + EndOfLine + EndOfLine + _
"CustomerType: " + invThis.type + " " + EndOfLine + _
"Customer name: "
break
b = dlg.ShowModalWithin(self)

When the program STOPS on the BRAK statement look at invThis.Type in the debugger
I suspect it has a nil encoding & that’s where part of your problem comes from - its “bytes” not a string with a known encoding

the variable is ok, I was debugging it.

where can I change the “ConvertEncoding” to “DefineEncoding” ?