Highlighted
Absent Member.
Absent Member.
2126 views

Inheritance

Jump to solution

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???

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Inheritance

Jump to solution

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.

View solution in original post

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Inheritance

Jump to solution

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.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Inheritance

Jump to solution

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.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Inheritance

Jump to solution

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

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Inheritance

Jump to solution

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.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.