LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
TCPlomp

Get or Set Variant attribute should not be polymorphic

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.

The Get and Set Variant attribute functions are polymorphic on the 'variant' input terminal.

 

Why?

What do you expect of the following code:

Example_VI_BD.png

 

I think allowing this is a bad technique in a 'early typed' language like LabVIEW.

 

Or am I missing something?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
4 Comments
TCPlomp
Trusted Enthusiast

Wel Set might be polymorphic.

 

But Get?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
AristosQueue (NI)
NI Employee (retired)

The terminal is NOT polymorphic.  And it is behaving exactly correctly.

 

This node takes a variant as an input. You wired something not a variant, so you get a coercion dot. LabVIEW will happily create a variant for you from the given data. It does that for any terminal that is variant type.

 

(Note: If the node were polymorphic, there wouldn't be a coercion dot because the node would be converting over to whatever version of itself accepts a boolean.)

Message Edited by Aristos Queue on 01-04-2010 05:33 PM
TCPlomp
Trusted Enthusiast

Point taken!

 

this idea can be rejected.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.