Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CALL-CONVENTION 3 IS WINAPI

Status
Not open for further replies.

rustym

Programmer
Aug 9, 2001
11
0
0
US
Would someone explain to me the syntax of the following paragraph? It is in
the Identification Division of the program I'm studying, and must have
something to do with setting up to make calls to the Win API...

SPECIAL-NAMES.
CALL-CONVENTION 3 IS WINAPI
 
CALL-CONVENTION is an extension used by the compiler maker. Yes, that one is used to format calls to the Windows Application Programming Interface. You will have to see what your manual says, as it is NOT in the 1985 Standard, NOT in IBM Mainframe COBOL (which I use), and in the 2002 standard, it will be an implementor-defined compiler option.

Stephen J Spiro
Member, J4 COBOL Standards Committee
check it out at

stephenjspiro at hotmail.com
 
Thanks, Stephen. Right now I'm not sure what system it is written for, but I have to port it over to the system we are using. We will be making a distributed app, using Micro Focus Cobol, maintaining the front end of Easel! It will be accessing IMS on our MVS mainframe.

The module I'm studying has 'USINGF blah-blah' in the PRCEEDURE DIV paragraph... this means this is a CALLed program, correct? A call to another program later in the proceedure div goes like this:

CALL WINAPI ARCH-LUWCOMM USING ARCH-LUW-TO-CALL
L1-COMPL-CODE
L1-IO-AREA-LENGTH
L001-IO-AREA.

I guess the three values are sent to the CALLed program. Is this CALL syntax familiar to you?

Rusty
 
YOu are correct in that when you call a program, the calling program will have code which states:

CALL PROGRAM-A USING DATA-AREA-X, DATA-AREA-Y.

The data for these two data areas will be coded within the calling program, usually in its Working Storage, or perhaps in Linkage if this is part of a chain of programs.

PROGRAM-A's Procedure division will be coded:

PROCEDURE DIVISION USING DATA-AREA-X, DATA-AREA-Y.

And the actual data area descriptions should be coded in the Linkage section.

Hope this helps, Nina Too
 
The CALL CONVENTION _should_ be pretty transparent to the application programmer. Most calls will look the same in any dialect of COBOL. Some calls have a RETURNING field in some dialects. But I think the most common reason for specifying a CALL CONVENTION in a program would be that it is operating in an environment where more than one operating system may be used ... such as DOS and Windows.
Try the MicroFocus Help line; they are very good, in my opinion.

Ahhhhh... looking again at your code, I see that you have
CALL WINAPI ARCHLUWCOMM USING....
WINAPI tells the compiler which CALL CONVENTION to use, ARCHLUWCOMM is the program being called.

By the way, you realize that you must have the called program in your new environment, otherwise the call will not work.

You might get more help in the comp.lang.cobol newsgroup; a large number of the participants there are experts in the various PC COBOL dialects.

Stephen J Spiro
Member, J4 COBOL Standards Committee
check it out at

stephenjspiro at hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top