With Data Inheritance VC

Is it possible to have inheritance  with data between Cobol.Net classes the same way that classes in  OOCobol do? If this isn't possible is there any workaround?

  • Verified Answer

    I assume that when you are talking about OOCobol you are talking about Net Express native OO programs that use the Net Express class libraries is that correct?

    The native OO syntax supported in Net Express is still supported in Visual COBOL but only for native code projects.

    Managed code .NET projects have a new syntax and not all old constructs are supported.

    INHERITS WITH DATA is one of those constructs that is not supported in the managed .NET syntax.

    In managed code, all data items in a parent class that are declared as public are automatically inherited by a child class but in order to access these data items in the child class you would need to use the SUPER::mydataitem syntax.

    If you were accessing a data item defined as a property in the parent class from a class that held an instance of the child class then you could access the data item using something like:

    set myobject::mydataitem to ...

    Is this what you are looking for?

  • Thanks for the answer. The problem is the number of variables,  so is the effort of rewriting the code that scares me alot.  :-(