Skip to main content

 

Good Morning:
I am trying to adapt a part of a C# program (Forms) for Cobol and there is a part that I don't understand.

For example:
                this.Amount=operation.Amount;
                this.Date=operation.Date;
                this.Destination=operation.Destination;
is converted to:
               set self::Amount to operation::Amount
               set self::Date to operation::Date
               set self::Destination to operation::Destination

What is the "this." statement and how to use the converted statement "self ::".

Thanks
Alberto Ferraz

 

 

Good Morning:
I am trying to adapt a part of a C# program (Forms) for Cobol and there is a part that I don't understand.

For example:
                this.Amount=operation.Amount;
                this.Date=operation.Date;
                this.Destination=operation.Destination;
is converted to:
               set self::Amount to operation::Amount
               set self::Date to operation::Date
               set self::Destination to operation::Destination

What is the "this." statement and how to use the converted statement "self ::".

Thanks
Alberto Ferraz

 

There is a definition of the "this" keyword in C# here.

In a nutshell it means:

The this keyword refers to the current instance of the class and is also used as a modifier of the first parameter of an extension method.

"self" is the COBOL equivalent to "this"

For  example within a Windows Forms application it refers to the current running form. If you have two forms active, form1 and form2 then when referenced within the form1 object "self" refers to the form1 object and when referenced within form2 it refers to the form2 object.

 


There is a definition of the "this" keyword in C# here.

In a nutshell it means:

The this keyword refers to the current instance of the class and is also used as a modifier of the first parameter of an extension method.

"self" is the COBOL equivalent to "this"

For  example within a Windows Forms application it refers to the current running form. If you have two forms active, form1 and form2 then when referenced within the form1 object "self" refers to the form1 object and when referenced within form2 it refers to the form2 object.

 

Hi Chris,

As i understand it, "self ::" replaces the screen name.

For example, in the program "TestXpto" we had the field "TextValue". Instead of using the TextXpto :: TextValue field, we use self :: TextValue.

Thanks

Best regards