Calling a function from within a project

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.

  • Verified Answer

    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.

  • 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.