× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jon,

A quick question that occurred to me:

If I define a MODS in one program, set the occurrence to 1 and pass it to a
second program and that called program then loads the MODS with data, does
the called program need to reset the occurrence to 1 before returning to the
calling program?

I'm assuming here that obviously the MODS isn't passed using CONST or VALUE
or anything like that.

Rory

On Tue, Feb 22, 2011 at 11:24 AM, Jon Paris <jon.paris@xxxxxxxxxxxxxx>wrote:


On Feb 22, 2011, at 1:00 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

I'd like to know why this code crashes on the SECOND call to mysp :
In mysp, at the execution of "eval parmError = blank", I'm getting
MCH3601 'pointer not defined for referenced memory position'

If I do : "%OCCUR ( myMODS ) = 1;" before the call to mysp, the problem
does not occur.

When a MODS is passed as a parm the address of the current occurrence is
what is passed. The writer of the second program had it right in a way in
that only one instance is ever (effectively) passed.

Without knowing what the called routine does or how the external DS is
defined, I'd have to just guess that the code attempts to retrieve data
beyond the scope of the item or something.

Unless you _want_ to pass occurrences other than 1 as the starting point
you should always set the occurrence to one before passing a MODS as a parm.


Jon paris

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.