Highlighted
Absent Member.
Absent Member.
845 views

Calling a function from within a project

Jump to solution

Hello,
the only way I know is to have another project which is linked to the "main" project.
In the linked project the function resides which can then be called from the "main" project.

Is there a way to put a function in "main" project and also call it from there.

I am using Visual Cobol 2.2 with Eclipse and remote projects. The projects are unmanaged Cobol.

Thanks for any information on this topic.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling a function from within a project

Jump to solution

Can you please clarify what you mean by "function"? Do you mean an actual COBOL function or are you referring to an entry point within a COBOL subprogram?

What type of executable code are you generating? .int, .gnt, .so? Since each project has it's own output build folder you need to link these together if you are calling a program in one executable, such as an .so from another executable.

If you moved the COBOL source program directly into your main project and the output type was single executable then this program would then be available within the same executable and you would not have to link to a separate project.

The design is really up to you. If this function or subprogram is shared by many modules or projects then it should be in a separate project so you are not linking it into each project that uses it.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling a function from within a project

Jump to solution

Can you please clarify what you mean by "function"? Do you mean an actual COBOL function or are you referring to an entry point within a COBOL subprogram?

What type of executable code are you generating? .int, .gnt, .so? Since each project has it's own output build folder you need to link these together if you are calling a program in one executable, such as an .so from another executable.

If you moved the COBOL source program directly into your main project and the output type was single executable then this program would then be available within the same executable and you would not have to link to a separate project.

The design is really up to you. If this function or subprogram is shared by many modules or projects then it should be in a separate project so you are not linking it into each project that uses it.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Calling a function from within a project

Jump to solution

What I mean with function is a program with a linkage section and call params, which I want to call from another program.

But I think you answered everything I wanted to know.

Thanks.

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.