LabVIEW Idea Exchange

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

Return a Warning if Default Variant Value is compatible but different

Status: New

The code below will execute without error or warning. The value returned will be 127 in this case.

 

Why is that? I understand the error 91 is returned if the typedefs are incompatible but if the type is different but compatible I would expect a warning maybe?

 

Cheers,

Jimmy

 

var.png

1 Comment
wiebe@CARYA
Knight of NI

That works because coercion happens automatically.

 

As far as your example goes, it's also why maps are so great; they are strong typed, no more variants!

 

Establishing 'when a type is different' is not that that easy. See Compare Variant Types.