Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Using procedure and function pointers

Procedure pointers are data items defined with the USAGE IS PROCEDURE-POINTER clause. Function pointers are data items defined with the USAGE IS FUNCTION-POINTER clause.

In this information, “pointer” refers to either a procedure-pointer data item or a function-pointer data item. You can set either of these data items to contain entry addresses of, or pointers to, these entry points:

You can set a pointer data item only by using the SET statement. For example:

CALL 'MyCFunc' RETURNING ptr.
SET  proc-ptr  TO ptr.
CALL proc-ptr  USING dataname.

Suppose that you set a pointer item to an entry address in a load module that is called by a CALL identifier statement, and your program later cancels that called module. The pointer item becomes undefined, and reference to it thereafter is not reliable.

related references
PROCEDURE-POINTER phrase (COBOL for Windows Language Reference)
SET statement (COBOL for Windows Language Reference)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)