Chr(10) adds a space after new line

Option Explicit

Call Main()

Sub Main()
Dim txt
txt = “-1-” + chr(10) + “-2-” & chr(10) + “-3-”
Rhino.AddText txt, Array(0, 0, 0)
End Sub

results in:

Hello - It may be AddText() that is doing this - if I copy to the clipboard and paste into a text editor I do not get the leading space. @dale - do you have an idea? vbNewLine has the same result.

Call Main()
Sub Main()
	Dim text: text = "X" + chr(10)+ "3"
	Rhino.Print text
	Rhino.ClipboardText text
	Rhino.AddText text, array(0, 0, 0)
End Sub

-Pascal

1 Like

Hi @Asterisk, why concatenate with a + and & sign ? Below seems to work over here, i do not get the blank space, even with your example code:

txt = "-1-" & chr(10) & "-2-" & chr(10) & "-3-"

Or this:

txt = "-1-" & vbCrlf & "-2-" & vbCrlf & "-3-"

Maybe this is a language specific problem ?

_
c.

Yep, my fault.

https://mcneel.myjetbrains.com/youtrack/issue/RH-52261

– Dale

It was “&” originally and I tested if “+” would work or even fix the issue. So… :stuck_out_tongue:

wasn’t aware of vbCrlf

RH-52261 is fixed in the latest Service Release Candidate

1 Like