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



Ken,

Thanks. I see. A global variable like system time, system date, or
some random global environment variable used by the overall application
by reference could change during the call. That makes the question more
sensible. Although memory is at a premium on some systems, I've always
found that a constant SHOULD be a temporary variable that can not be
altered. I suppose I'm afforded the privilege of quick hit calls on a
high memory system, so short term memory usage hasn't been an issue for
me yet. I forget that not everyone has the budget or benefit of high
availability systems.

Address reference, although memory conservative, isn't always the best
approach, either, especially if it's a service program with coded memory
or LPAR limitations. Wouldn't it be more beneficial to utilize the
built-in process queue to throttle requests based on processor
availability in these situations? It may increase the processing time
by a few milliseconds, but wouldn't it increase the accuracy at the same
time?

Tom Armbruster
Systems Integration Manager
Travelocity On Location
http://www.showtickets.com

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Ken Sims
Sent: Thursday, November 15, 2007 1:53 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Another ILE question : CONST vs VALUE

Hi Tom -

On Thu, 15 Nov 2007 15:21:44 -0600, "Armbruster, Tom"
<Tom.Armbruster@xxxxxxxxxxxxxxx> wrote:

Why would the CONST value change outside of the procedure during a
call,
and why would it matter? The CONST value is for processing at the time
of the call, so even if the value were say a timestamp, it would be the
value at the time of the call. Can someone provide an example as to
when a constant value provided to a program would be altered during the
called procedure and what effect it might have?

CONST doesn't always require a temporary variable. If a single field
(rather than a constant or an expression) is specified on the call and
the length and type match the prototype, there is no need for a
temporary variable.

If there is no temporary variable, and if the field on the call is
global, and if that global field is changed within the procedure, then
the value of the procedure parameter field will also change because
it's the same memory area.

It would be good if there were a keyword that could be used along with
CONST, or as a replacement for CONST, which would force a temporary
variable to always be used.

Ken
Opinions expressed are my own and do not necessarily represent the views

of my employer or anyone in their right mind.

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.