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



> From: Bob cozzi
> 
> Joe,
> Why on Earth would you call a module?
> That is the strangest design decision I have seen on this ILE
architecture
> (not your's specifically just in general).
> I mean if you have:
>   CALLP  'MYMODULE'

Um.  Who said I was calling a module, Bob?

Basically, I'm using procedures within a program with a MAIN.  These
procedures perform tasks that require the preservation of data between
calls (static data).  While I can do this using global variables, I'd
rather this data not be visible outside the scope of the procedure, thus
I'd like to use local variables.

So, the obvious choice is to use local static variables with an
initializer.

The problem is that I would like these variables reinitialized each time
the program is called, but they are not (even if the program is bound
with ACTGRP(*NEW)!).  Thus, I have to manually reinitialize the
variables.  And since the data is local to the procedure, I must call
the procedure to initialize the data.  To date, I have done this by
passing no parameters to the procedure.  (This of course only works if
the procedure normally requires parameters.)

I'm not sure where you got "calling a module" from, except maybe by
reading between the lines I quoted of Barbara's explanation.

Joe


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.