06-23-2022 02:40 PM
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!
Solved! Go to Solution.
06-23-2022 02:55 PM - edited 06-23-2022 02:55 PM
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"
06-23-2022 03:01 PM
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?
06-23-2022 03:17 PM
There are two "enter keys" on your keyboard.
They behave differently depending on your LV options.
06-23-2022 08:19 PM
@Frozen wrote:
There are two "enter keys" on your keyboard.
They behave differently depending on your LV options.
If that option is checked, you can use Ctrl+Enter to apply an EOL.
06-24-2022 03:01 AM - edited 06-24-2022 03:03 AM
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.
06-24-2022 07:30 AM
@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.