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



I thought I've heard someone in this list said something about
import/export is not a good approach and should try to minimize using
them. Please correct me if this is not true.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Wednesday, August 15, 2007 2:35 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Data from an RPGLE program being avaialble in a bound
module

I looked at the program & module I am maintaining and import/export is
used extensively in them. It had not dawned on me what they were for.
To be consistent I have used import/export and the problem is solved.

Thanks to all that answered so clearly and quickly.




Buck wrote:
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


--
---------------------------------
Booth Martin
http://www.Martinvt.com
---------------------------------

--
This is the RPG programming on the AS400 / iSeries (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 ...

Follow-Ups:
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.