Hi,

I’ve just modified a module that uses a program call using a pointer,
and I need some reassuring.

My question is, in the example below, If I execute DoStuff1, then
DoStuff2, have I changed the value of Parm1?
Does Parm=LocalVar mean that Parm is a copy of the date pointed to by LocalVar?

The 2 procedures cannot run together at the moment, but I don't want
to think I may have left a booby trap for some future programmer.
Thanks.


In the original module, I had :

DoStuff1 (Parm1);

P DoStuff1 PI
D Parm
LIKE (…)

D MyPointer S *
D LocalVar S N BASED (MyPointer)

Call MyPGM(‘1’ : MyPointer)

Parm = LocalVar;
Return;

Then I added :

DoStuff2 (Parm2);

P DoStuff2 pi
D Parm
LIKE (…)

D MyPointer S *
D LocalVar S N BASED (MyPointer)

Call MyPGM(‘2’ : MyPointer)

Parm = LocalVar;
Return;

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.