I think Carel may be on the right track in saying we are losing the
address when we exit the procedure. I debugged in both environments and
found:
1. In the environment where the error is thrown, the flow is:
Execute procedure
%ALLOC
Exit procedure
Many calls into the procedure, we finally have data to store in the
array so we %REALLOC
2. In the environment where it works, the flow is:
Execute procedure
%ALLOC
We have data to store so,
%REALLOC
Exit procedure
So, even though the value in the pointer doesn't change, I am guessing
that leaving the procedure is resulting in us losing the address from
memory.
I'm going to have the programmer fix the logic so that we only do the
ALLOC and REALLOC when we actually find data to store in the array!
That may be it after all.
Thanks again.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, July 30, 2008 4:45 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: CEE0810 Error on Reallocate Statement
Who cares what the scope of 'wa' is?
The scope of 'arrayPtr' might be an issue -- if the symptoms were a
little different -- but I can't see how the scope of 'wa' could ever
matter!
At this point, I'm betting that either the memory has already been
dealloc/realloc or that there's memory corruption.
Kurt Anderson wrote:
Lorraine, just as a fyi, wa is scoped locally (to the procedure) as
opposed to globablly (to the service program). Sorry I don't have
anything otherwise helpful to pitch in here.
As an Amazon Associate we earn from qualifying purchases.