LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
CuriousSwede

Immutable Boolean constants

Status: New

I´m not to fond of the native Boolean constants and their ability to change value by just a mouse click. To me that is not a behaviour of a constant. What if Pi could be changed to e with a mouse click?

The issue is that when clicking around and cleaning up a messy diagram you may by mistake change a Boolean constant without noticing.

I would like to have native immutable Boolean constants like the ones I´ve implemented with two small VIs. My artwork is perhaps not the best, better ideas are up for anyone´s suggestion.

 

CuriousSwede_0-1702651324354.png

 

5 Comments
crossrulz
Knight of NI

Or just simply make it more difficult to change the value than a simple mouse click.  Though, I usually use a Ctrl+Click to select items for this reason.


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
CuriousSwede
Member

"Or just simply make it more difficult to change the value than a simple mouse click."

Yes, that is probably the right way to go.

Put an item in Options >> Block Diagram called something like Change Boolean constant values only by right-clicking, with value True or False

srlm
Member

What if Pi could be changed to e with a mouse click?

 

That's been suggested in the Idea Exchange before -- can't find it right now, but "left click, pick new value" is a requested thing. Some people like lower guard rails. I don't think I've ever accidentally flipped a True to a False -- the visual change is pretty striking if I misclick it on drag -- but I guess if I had done it by accident, I admit I might not know it  because when debugging later it would just look like a constant I got wrong unless earlier that day. But it's a pretty narrow window for the problem to exist: for a misclick like that to break existing code, it would have to be me making the mistake without noticing, the reviewer of my PR missing a change unrelated to my commit title, and none of the existing unit tests breaking. It just doesn't seem like a high threat to me. 

CuriousSwede
Member

srlm wrote:

 

"But it's a pretty narrow window for the problem to exist: for a misclick like that to break existing code, it would have to be me making the mistake without noticing, the reviewer of my PR missing a change unrelated to my commit title, and none of the existing unit tests breaking. It just doesn't seem like a high threat to me."

 

Yes, your're right. But it´s exactly in that case that the error may be critical, showing up later on in a most unconvinient way.

 

Henrik_Volkers
Trusted Enthusiast

You are rigth about a constant is a constant.  Maybe it shouldn't be a single click to change it. Other editable constants need more action to change it. Maybe a doubleclick to change it is fine?

 

Or how about:

Keep it in the pallette as it is,

in the right-click Data Operation menu you already have the option to Change Value to TRUE/FALSE

(never used it, but it is alrady there 😉 )

Add the option : Allow Change in BD  with a flag, and allow the user to set the default value in the INI-file and/or under Tools/Options.../Blockdiagram

 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'