Hello, I want to call a procedure with as parameter a pointer to an external data structure; In the called procedure I want to read the data of the external data structure by using the passed pointer, but it doesn't work. In the dump is the external data structure of the procedure not addressable. Has anybody an idea how to solve this ? Calling program D D PRDBKHDS E DS EXTNAME(PRDBKH) D D Ptr_PrdBkh S * Inz(%Addr(PRDBKHDS)) D C Callp T_PrdBkh(Ptr_PrdBkh) Called procedure P T_PrdBkh B Export D* D T_PrdBkh PI D P_PrdBkhPtr * Const D* DPRDBKHDS E DS EXTNAME(PRDBKH) D Based(P_PrdBkhPtr) C*
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Pointer passing with external data structures
Collapse
X
-
Pointer passing with external data structures
Called procedureP T_PrdBkh B Export D* D T_PrdBkh PI D P_PrdBkhPtr * Const D* DPRDBKHDS E DS EXTNAME(PRDBKH) D Based(P_PrdBkhPtr) C*
Eric, I'm doing much the same as what you're attempting, but I'm not having any trouble getting it to work. A difference between my working code and yours is that I base my data structure in the called procedure on a local pointer variable, and assign this local variable to the value of the pointer passed. I can vaguely recall difficulties arising whenever I based anything directly on the pointer that was passed.
Comment