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




On 03/04/2008, at 8:47 AM, Tom Liotta wrote:

One thing that isn't clear to me is what happens when repeated
ADDRESS statements refer to the _same_ environment that is already
saved as the 'permanent' environment. I.e., what is the result of
saying ADDRESS COMMAND when COMMAND is already the environment?

Has no effect. Rexx supports 3 environment states: ACTIVE, ALTERNATE, and TRANSIENT.

ACTIVE is either the one it starts with or the one assigned via ADDRESS env-name. ALTERNATE is the one that existed prior to a change. At program start ACTIVE and ALTERNATE are the same. TRANSIENT is the environment used for the running of a specific command or statement such as:

ADDRESS *COMMAND 'DSPMSG'

This environment lasts only for the duration of the statement.

If ACTIVE is currently *COMMAND and you issue ADDRESS COMMAND then it stays ACTIVE. Effectively a NO-OP.

And then what happens when a later ADDRESS EXECSQL is thrown in?

*EXECSQL becomes the ACTIVE environment and the previous becomes the ALTERNATE. Issuing ADDRESS on its own toggles between them.

And what happens when the environment is reverted back to the previous?

In what way. The previous is now the ACTIVE and the old active is now the ALTERNATE.

It gets a bit messier with *COMMAND, *EXECSQL, and *CPICOMM in the same Rexx program because only one can be ACTIVE, one can be ALTERNATE and the other is simply dropped. In these cases you would set ACTIVE and ALTERNATE to the most used and use TRANSIENT for the other(s).

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.