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



Like I said, unless you have to. SQL not being free(IBM, why, why why) is one 
place where I still use them. I used subroutines for screen programs until 
recently and converted to subprocedures but even then, I used them inside a 
subprocedure. Works very nicely. Having local variable for things like 
LoadOnePage makes things a lot clear and simpler.  See my Trigger Mediator 
TG0002 for examples. 

Also, opinion, I think freeing SQL in RPG/ILE is so important IBM ought to do 
it and put it into the SQL pre-compiler as a PTF. Anybody else think so? The 
only thing that is effected is the SQL pre-compiler and not much of that. Why 
is IBM making it such a big deal? 

>> -----Original Message-----
>> From: Joe Pluta [mailto:joepluta@xxxxxxxxxxxxxxxxx]
>> Sent: Wednesday, July 27, 2005 10:52 AM
>> To: 'RPG programming on the AS400 / iSeries'
>> Subject: RE: No Subroutines (was Re: Debugging many subprocedures)


>> The opinions of my esteemed colleagues' Mssrs. Gibbs and Campin
>> notwithstanding, I think "no subroutines" is a little bit of overkill.
>> Subroutines are quite useful for segmenting code where the code is
>> already using global constructs.  For example, I find it quite nice for
>> separating the various routines of a UI program; I have one subroutine
>> for each page, and one subroutine for each function in the page.  I then
>> cycle through the subroutines using state variables.  Since the pages
>> all access the screen fields and they themselves are by definition
>> global, little is gained by turning these subroutines into procedures.

>> Another place where subroutines come in handy is in the segmenting of
>> non-free-form opcodes, especially embedded SQL.  In order to avoid the
>> ugliness of /free and /end-free, I can put my SQL code into subroutines
>> and then invoke them from business logic written in /free.

>> I just don't agree with the blanket assertion that subroutines are
>> always bad.  Every block of code doesn't necessarily need the
>> syntactical overhead of a procedure and the associated prototype.

>> Joe


> From: Mike Wills
> 
> Really? That is a good thing? Why is that?
> 
> On 7/27/05, David Gibbs <david@xxxxxxxxxxxx> wrote:
> >
> > Mike Wills wrote:
> > > I my vendor's infinite wisdom, there is not subroutines in their
code,
> > it is
> > > all subprocedures.
> >
> > In that respect, they are truly wise. Seriously.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.