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



The main problem with Import/Export is that you are subject to side-effects. When looking at a given piece of code you have no idea who or what can modify the data. From my main module I call ProcB - has the data changed as a result? I don't know without studying the code of ProcB. At least if I passed it as a parm I know (unless I specify CONST or VALUE on the proto) that it could change. It shouldn't but ...

As a rule of thumb I try to never use import/export and try to avoid modifying any parameters passed to me. If the procedure changes data it should return that value to me. That was a problem for large return values - but no longer thanks to RTNPARM. Sometimes you're stuck with calling an API or some other piece of code that breaks those rules - but hey - rules are made to be broken so I just make sure that I document that I ex[pect the parm to change.


In rare cases (next available invoice number for example) I might use a data area or user space - but never import/export.


Just my take


Jon Paris

On May 12, 2021, at 1:20 PM, Suren K <suren7437@xxxxxxxxx> wrote:

Hi Jon,

I am planning to use the Export/Import variables instead of passing pointer
variables. Are you recommending not to use Export/Import variables?

For example, I have more than one procedure to build the data, instead of
using the same pointer in all the procedures which will be larger length, I
can use one export variable (smaller) for one procedure and in my main
program I am planning to import all the exported variables and concatenate
all the values coming in.

Regards,
Suren



Are you recommending not to use Export Import variables?

Regards,
Suren

On Wed, May 12, 2021 at 10:35 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

Your best option is STOP IT

If you have to share data like this use a mapped User Space of Data Area.
Exports are one of the things I really wish we hadn't included in ILE. They
seemed a good yes at the time but ...

Just my opinion ...


Jon P

On May 12, 2021, at 12:42 PM, Suren K <suren7437@xxxxxxxxx> wrote:

Hi Everyone,

Currently I am maintaining two stand alone applications. But at runtime
both application libraries will be added in a single session/environment.

So I am trying to use an EXPORT Variable of Application 1 in Application
2.
While compiling the compiler fails because it was not able to identify
the
Imported variable symbol. In run time I know the Exported variable will
be
available, so while compiling the CRTPGM and CRTSRVPGM i am
giving OPTION(*UNRSLVREF) to allow the unresolved references.

Do we have any similar options available for CRTBNDRPG or CRTSQLRPGI to
allow the unresolved references?

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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


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.