Inheritance

Hi,

i need help with inheritance in visual cobol. I have a .Net class (cobol) named ClassB which inherits from another .Net ClassA (cobol again). In ClassA i have a public property named VariabA. the problem is that i cant access variabA unless i use the keywords self:: or super::. This is a huge problem since is not a normal behavior for inheritance as a feature and it's a stopper for using VariabA as needed (eg in an Exec Sql statement). The same thing in other .Net language is not an issue.... Can you help me please???

  • Actually the requirement to use self or super in order to access public fields or properties in an inherited class was removed in the compiler as of V2.2 update 2. The support for this in Intellisense within the IDE has not yet been implemented so although the variables do not appear in the Intellisense list without specifying self or super you can still specify them manually.

    This refers only to accessing these variables within the compiled body of the class. It does not include support for using them within EXEC SQL statements which are processed by the OpenESQL preprocessor. All host variables specified within EXEC SQL statements must be defined within the current class.

    I will have to check with development to see if this type of support is currently planned.

    Thanks.

  • I checked with development and the use of inherited data items as host variables in OpenESQL is not currently supported in the product.

    I would suggest that you open up a support incident with Customer Care and add attn: Chris Glazier in the description then it will be assigned to me. I can then go ahead and create a bug report to see if we can get this problem addressed.

    Thanks.

  • Thank you again!! Did you get my message about suggestions?

  • Verified Answer

    I ask that you please do not send private messages to me directly on this forum as the private message function of this community site does not currently allow me to reply to messages. All questions and responses should be posted directly to this forum so they can be shared by all.

    I really have no workaround at the moment for what you are trying to do except to create a local copy of your data in the subclass to use as host variables and then set these to the variables in the base class before and after the sql. Either that or create a separate data only class containing the shared variables and pass the data around using that object.

    If you do not wish to change your current source code then I would suggest that we create a bug report for this so that we can add the functionality directly to the compiler.

    Thanks.