Highlighted
Contributor.
Contributor.
431 views

In a .net visual cobol windows form, can a global variable be declared in working storage that references self::?

Working-storage section.

01 s as new self.

Method.

invoke s::GetNumbers().

 

I know you can use declare x = new self in the method itself, but can you declare a global variable that represents self?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Self

Jump to solution
With more recent versions of Visual COBOL, you do not need to type self:: in this context. It's enough to just do:

invoke GetNumbers()

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Self

Jump to solution
self is already a global variable which can change depending on which object is currently being executed.
If you are within the Form methods then it will contain the current forms instance. If you change to a different object it will contain the value of that object.

What is it that you are trying to accomplish?
0 Likes
Highlighted
Contributor.
Contributor.

RE: Self

Jump to solution

not having to type the word self; probably a matter of being lazy i guess.  

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Self

Jump to solution
With more recent versions of Visual COBOL, you do not need to type self:: in this context. It's enough to just do:

invoke GetNumbers()

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.