Sign in to follow this  
Followers 0
Artz

Newline / Carry Return

4 posts in this topic

Hi

It is possible to specify a newline on a vb page on a NA Series Page?

Sub subroutine

Dim var as string

var = "Hello" + (insert newline) + "How are you?"

End sub

Edit: forgot to specify that the variable is Global (so no DIm...) and later used as a expression for a dataDisplay control.

Thank you in advance

Edited by Artz

Share this post


Link to post
Share on other sites

hi ,

yes , you can but with  &

var = "Hello" & newline & " How are you ?"

 

Share this post


Link to post
Share on other sites
16 hours ago, sergeFR said:

hi ,

yes , you can but with  &

var = "Hello" & newline & " How are you ?"

 

Sorry, maybe I didn't explain it correctly.

newline is not a variable. What I want to do is insert a carry return so I can visualize two lines, on the first one with "hello" and the second one "how are you" as an example.

Showing it later on a DataDisplay with multiple lines. I need to know if there is a special character available in VB .net on sysmac studio.

Share this post


Link to post
Share on other sites

Things I tried with an error as result:

  • "line1" & vbCrLf & "line2"
  • "line1" + vbCrLf + "line2"
  • "line1" & ch(13) & "line2"
  • "line1" + ch(13) + "line2"

I found the correct property to add so for those looking for the same the code would be:

anyStringVariable = "This is Line 1" & Environment.NewLine & "This is Line 2"

 

Edited by Artz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0