× 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.



Hi Doug,

the problem that you encounter IMHO has to do with 2 things:

Am 14.02.2024 um 17:45 schrieb DEnglander--- via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>:

I have a subprocedure in this program that performs a CHAIN to
the globally defined file.

1. Your record (and therefore the fields) are global

Both of these parameters are defined as "LIKE()" corresponding field names in
the global file and both parameters are defined with CONST.

2. The parameter(s) is/are CONST - not VALUE

In this case if you pass a/the global field to the procedure, and the type and length are the same, the compiler optimizes and indeed passes a pointer to the global field to the procedure - not a copy of the value. And it will only make sure, that the field isn't changed by any statement inside the procedure.

Right after the Chain, the Packed(9) parameter contains its original value, but
the second parameter becomes blank. It is as if the subprocedure is
overwriting the parameter values with the contents of the Chained record,
I am assuming because of the LIKE().

So when your CHAIN is changing the global field (see #1) the value of the CONST parameters are also changing, because it is just a pointer to the original field (see #2).

Without looking into your code, this seems to be most probable answer.

HTH and kind regards
Daniel


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.