Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Using procedure and function pointers

You can set procedure-pointer and function-pointer data items only by using format 6 of the SET statement.

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:

The SET statement sets the pointer to refer either to an entry point in the same load module as your program, to a separate load module, or to an entry point that is exported from a DLL, depending on the DYNAM|NODYNAM and DLL|NODLL compiler options. Therefore, consider these factors when using these pointer data items:

If you set a pointer item to an entry address in a dynamically called load module, and your program subsequently cancels that dynamically called module, then that pointer item becomes undefined. Reference to it thereafter is not reliable.

related references  
DLL  
DYNAM  
CANCEL statement (Enterprise COBOL Language Reference)  
Format 6: SET for procedure-pointer and function-pointer data items
   (Enterprise COBOL Language Reference)
  
ENTRY statement (Enterprise COBOL Language Reference)


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)