|
Booth Martin wrote:
What am I missing? I have an RPGLE program that defines and fills some fields with values. I have an RPGLE Module that is bound with the main program at compile time. I wish to use those main-program values in the module. I expected the values to be there, but debug says they are not.
In the literature, it's called 'scope.' A variable's scope can be thought of as places the variable can be used. Traditional RPG/400 code was easy because all variables are global in scope: any part of the program can use any variable.
ILE has brought us new rules regarding scope, and you've encountered one. Variables are scoped to the module they are defined in. You can override that behaviour with EXPORT and IMPORT keywords on the D specifications, but I strongly advise against it.
--buck
As an Amazon Associate we earn from qualifying purchases.
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.