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



What an interesting conversation this has turned into. I struggle sometimes 
which to use, subprocedures or subroutines (subroutines haven't won in 
awhile). Sometimes, rather than writing detialed error handling, it is nice 
to use a *PSSR subroutine that simply dumps for a small program that does a 
small task, but if you do this, and include the *PSSR as your file's INFSR, 
then you can't access the file from any subprocedures. Nowadays, I usually 
use the (E) extender and deal with file errors in more detail. 

When I first started using subprocedures a couple of years ago, I used 
global and local variables, but as I grew to understand the power of 
encapsulation, I now only use local variables, except for LIKEREC data 
structures. For these, I set up global LIKEREC structures, based on a 
non-existent pointer, then set up LIKEDS structures within the subprocedures 
for input and output. Also, EXTFILE variables. 

On 6/24/05, HauserSSS <Hauser@xxxxxxxxxxxxxxx> wrote:
> 
> Hi guys,
> 
> I'd never create a procedure, that cannot be encapsulated.
> To simply replace BEGSR through a P-statement
> and only use global variables does not make sense, in my opinion.


Now, I am also very rigorous in disallowing use of global variables in 
procedures. I try to create each one in it's own source member, and 
CRTRPGMOD each one separately, to enforce the non-use of global variables. 



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.