From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-06-2018 11:30 AM
I think I remember seeing somewhere that you get points deducted for using a general string constant that happens to be empty as opposed to an empty string constant. This might be mentioned in the style guide.
But I just noticed that you can't put an empty string constant in a cluster constant! Only a string constant that is empty.
So if I needed to create a cluster constant of empty strings, would I lose style points for using a string constant with nothing in it rather than an empty string constant? If so, is there a way to do this without losing style points?
Solved! Go to Solution.
11-06-2018 11:45 AM
I wouldn't worry about that. But, in cases where you do want an empty string, like to clear out an indicator, it is good to use dedicated empty string constant
12-13-2018 07:55 AM
The empty string constant isn't really a constant. Its really a vi similar to this:
saved without its block diagram. That is the reason it won't go in a cluster (and how would you change the string value?)
12-13-2018 03:15 PM
Makes sense! Thank you!
12-22-2018 11:00 AM
If you need to make a cluster constant, other things are much more important:
This often simplifies the code and is automatically self-documenting, especially if you later always use (un)bundle by name.
12-22-2018 11:15 AM - edited 12-22-2018 12:01 PM
@JÞB wrote:
That is the reason it won't go in a cluster (and how would you change the string value?)
This explanation is incorrect. It is true that the space constant is a VI (for no good reason, really), but primitives such as , EOL, Tab, -Inf, Pi, Ln2, etc. are NOT subVIs but still cannot go into a cluster constant container.
There reason is more general. Clusters cannot contain constants. Period. 😉
(They can contains other stuff such a free labels and decorations, though. :D)
( I guess disallowing constants was a very early design decision and probably not a bad one. Still, constant could be allowed in principle, because they just define a datatype and initial value)