LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Default values of cluster created from an empty Variant


wiebe@CARYA wrote:

Or make the 'invalid' enum value the first value of the enum. That would return 'invalid' as default in case of error.


Yes, true, but reordering Enums can sometimes be dangerous. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 11 of 14
(285 Views)

@Yamaeda wrote:

wiebe@CARYA wrote:

Or make the 'invalid' enum value the first value of the enum. That would return 'invalid' as default in case of error.


Yes, true, but reordering Enums can sometimes be dangerous. 🙂

/Y


Agreed and exactly where do you put the documentation to warn those that follow?

 

It would be better to be explicit in the code and spare those that inherit the code.

 

Who is that has the signature;

 

"Code like the person that will follow you is a psychopath that knows where you live."

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 12 of 14
(282 Views)

"Code like the person that will follow you is a psychopath that knows where you live." Smiley SurprisedSmiley LOLSmiley LOL

Wise words to live by!

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 14
(278 Views)

@Yamaeda wrote:

wiebe@CARYA wrote:

Or make the 'invalid' enum value the first value of the enum. That would return 'invalid' as default in case of error.


Yes, true, but reordering Enums can sometimes be dangerous. 🙂

/Y


Of course, of course. Especially\only when certain rules (using named (un) bundles) are not followed, it will be tricky.

That brings us to the topic of avoiding the Variant To Data altogether. OO would probably eliminate the need for it completely...

0 Kudos
Message 14 of 14
(266 Views)