Jump to content

To More Specific Class [Bug?]


Recommended Posts

Hi Jon,

You typecast from LVObject to LVObject, so I'd expect that you don't get an error for that with "To More Specific Class" prim. I suspect there would be a significant increase in overhead if this primitive were to dynamically check for the class hierarchy when it's fed with LVObject. It seems to me that this is like a using the code below:

<a href="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png" width="452" height="249" border="0" /></a>

While the other case is clearly wrong as expected.

In my opinion, this is not a bug in the behavior of the primitive but perhaps a bug in documentation?

  • Like 1
Link to comment

Hi Jon,

You typecast from LVObject to LVObject, so I'd expect that you don't get an error for that with "To More Specific Class" prim. I suspect there would be a significant increase in overhead if this primitive were to dynamically check for the class hierarchy when it's fed with LVObject. It seems to me that this is like a using the code below:

<a href="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png" width="452" height="249" border="0" /></a>

While the other case is clearly wrong as expected.

In my opinion, this is not a bug in the behavior of the primitive but perhaps a bug in documentation?

Thanks dude!

I want to run script that finds any member in Project that is a Child of Parent by Name/Ref (not static - so I can't use the constant).

Is there a better way to do this? - Given the above, I am thinking just looking at the Ancestor Paths for a match in path?

Link to comment

I think I am doing the same check however, with the GetLVClassDefaultValue.vi but it passes (but I expect it to fail).

Like Francois said, the downcast prim is based on wire type, not object type. Try using the Preserve Run Time Class prim to get the behavior you expect.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.