Skip to main content

This is code from a C# program:

using DevExpress.Xpo;

public class Customer : XPObject {
    public Customer() {}
    public Customer(Session session) :
            base(session) {
    }
XPObject and Session are DevExpress classes used for data binding.

In C#, a constructor initializer is the code that comes after a colon in a method definition.

My understanding is that ": base(session)" in the overloaded constructor will execute the overloaded constructor in the inherited class XPObject passing it the "session" parameter.  How would you code the above in Visual COBOL ?  I can't find documentation on it.  When DevExpress calls the Customer(Session) constructor, the constructor execution sequence should be:

- System.Object.Object

- XPObject (Session)

- Customer(Session)  which in my COBOL program would be NEW(Session).

This is code from a C# program:

using DevExpress.Xpo;

public class Customer : XPObject {
    public Customer() {}
    public Customer(Session session) :
            base(session) {
    }
XPObject and Session are DevExpress classes used for data binding.

In C#, a constructor initializer is the code that comes after a colon in a method definition.

My understanding is that ": base(session)" in the overloaded constructor will execute the overloaded constructor in the inherited class XPObject passing it the "session" parameter.  How would you code the above in Visual COBOL ?  I can't find documentation on it.  When DevExpress calls the Customer(Session) constructor, the constructor execution sequence should be:

- System.Object.Object

- XPObject (Session)

- Customer(Session)  which in my COBOL program would be NEW(Session).

Hi Phil, should be something like:

method-id new.

procedure division using by value session as type Session.

   invoke super::new(session)

   ....

end method.


This is code from a C# program:

using DevExpress.Xpo;

public class Customer : XPObject {
    public Customer() {}
    public Customer(Session session) :
            base(session) {
    }
XPObject and Session are DevExpress classes used for data binding.

In C#, a constructor initializer is the code that comes after a colon in a method definition.

My understanding is that ": base(session)" in the overloaded constructor will execute the overloaded constructor in the inherited class XPObject passing it the "session" parameter.  How would you code the above in Visual COBOL ?  I can't find documentation on it.  When DevExpress calls the Customer(Session) constructor, the constructor execution sequence should be:

- System.Object.Object

- XPObject (Session)

- Customer(Session)  which in my COBOL program would be NEW(Session).

Thanks Robert.  That compiled.  Now I can use a bunch of DevExpress data binding tools.