LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

if father class and children class has a same type and same name parameter,how can I get father parameter by children class?

if father class and children class has a same type and same name parameter,how can I get father parameter by children class? who can show me an example?

 

0 Kudos
Message 1 of 3
(722 Views)

Do you mean a private class data member? If it is that you would create a property accessor for the father private data value (the child value you can access directly but if you want to create a property accessor too, you would have to give it a different name.

 

However the whole thing sounds like a code smell. Why do they have to have the same name and why do you need them both in the child class? Either your child should overwrite it or it should have a different name. 

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(688 Views)

@yanzhanglin wrote:

if father class and children class has a same type and same name parameter,how can I get father parameter by children class? who can show me an example?

 


Sounds like Call Parent (use QD) to me.

 

Call parent invokes the VI of the ancestor (parent, grand parent, etc.) class you're overwritten. 

 

For instance, the child method "Get Text.vi" can call the parent "Get Text.vi" to extend the info:

wiebeCARYA_0-1683647631718.png

 

This is not to be confused with invoking the same VI on a contained class of the same type. This could trigger a recurrent call, if the contained object is the same as the calling class.

0 Kudos
Message 3 of 3
(651 Views)