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



> Just to be sure, did I read the following into Scott's last post:
>
> if you want to retain the value of a local procedure variable through
> multiple calls of the procedure, then you must use the static keyword on
> that variable definition?

Yes.  That's true...  That Scott guy sure is smart! :)

Here's a quote from the WSDS ILE RPG Reference manual:

   For a local variable of a subprocedure, the STATIC keyword specifies
   that the data item is to be stored in static storage, and thereby hold its
   value across calls to the procedure in which it is defined. The
   keyword can only be used within a subprocedure. All global fields are
   static.

   The data item is initialized when the program or service program it is
   contained in is first activated. It is not reinitialized again, even if
   reinitialization occurs for global definitions as part of normal cycle
   processing.

   If STATIC is not specified, then any locally defined data item is
   stored in automatic storage. Data stored in automatic storage is
   initialized at the beginning of every call. When a procedure is
   called recursively, each invocation gets its own copy of the storage.



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.