LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String End of Line Constant

Solved!
Go to solution

How to I insert a End of Line Constant by using a keyboard key instead of the LabVIEW End of Line Constant for a multi-line string inside String Constant?

Thanks y'all!

0 Kudos
Message 1 of 7
(322 Views)
Solution
Accepted by topic author ssutt

I don't quite understand what you want to do, but I think I can shed some light on what is going on. There is a carriage return (ascii code 13) and line feed (ascii code 10). Both are normally not visible characters. The upper string constant in your code uses both carriage return and life feed. The lower string only uses line feed. You can see the hidden characters (represented by \r and \n) by changing the display style to "\ Codes Display"

 

cr-lf.png

 

 

Message 2 of 7
(310 Views)

O wow. Geat! Thanks!

ps: what key does that without the havint to manually edit the "\ Codes Display" format. Or is that the only way?

0 Kudos
Message 3 of 7
(305 Views)
Solution
Accepted by topic author ssutt

There are two "enter keys" on your keyboard.

They behave differently depending on your LV options.

Frozen_0-1656015385072.png

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 4 of 7
(285 Views)

@Frozen wrote:

There are two "enter keys" on your keyboard.

They behave differently depending on your LV options.

Frozen_0-1656015385072.png

 


If that option is checked, you can use Ctrl+Enter to apply an EOL.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(231 Views)

Another little tidbit of information.

 

The LabVIEW internal line break character is \n. This is also what is normally added to a string when you hit Enter (or with that option to terminate string entry with Enter enabled, when you hit Ctrl-Enter).

 

Then you have Write Text File and Read Text File functions where you can enable Convert EOL. If this is enabled LabVIEW will convert the internal \n character to whatever is the external line break character sequence on the current platform.

 

On reading a file with that mode enabled it will convert the external file stream into its internal line break format.

On writing it will do the opposite when that mode is enabled, unless it already is that character sequence.

 

The external line break character sequence is:

 

Windows:        \r\n

Unix Variants: \n

Mac Classic:   \r

 

LabVIEW itself is tolerant to strings that contain the Windows line break character sequence but prefers internally the single \n as line break identification.

Rolf Kalbermatter
Averna BV
Message 6 of 7
(215 Views)

@StevenD wrote:

You can see the hidden characters (represented by \r and \n) by changing the display style to "\ Codes Display"


If you do change the display mode from the normal, you really should also show the display style (right-click on the control/indicator/constant and choose Visible Items->Display Style).  This simple thing helps quite a bit in knowing exactly what your data is.  I often find the Hex style useful when dealing with certain devices.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(192 Views)