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



> I couldn't agree more: my first recommendation is to
> find a subroutine that has been copied all over the
> place (c'mon, we've all got 'em!)  Make a new
> *MODULE out of just that code, and the next
> time you work on a program, replace the EXSR
> with the prototype /copy and a myProcedure()
> call.

For a very first step, I would omit the *MODULE and put the entire procedure
in one /COPY member while putting the PR in another /COPY member (I use
QPROTOSRC for that.  Thanks to David Morris for the suggestion!)  So, I'd
have 3 source members:

QRPGLESRC mainpgm
QRPGLESRC subprocedure
QPROTOSRC subprocedure

The main program would look something like this:

/copy qprotosrc,myfunc
*entry plist
...
eval answer=myfunc(some_data)
...
/copy qrpglesrc,myfunc
return

When you need to re-use myfunc, just use the two /COPY statements.  Because
all of the variables within myfunc are local, you won't have to worry about
duplicate names.  When the day comes that you want to move these into a
service program (I would skip modules!), you just pull the second /COPY and
re-compile!

> Or you could download a tool library like mine [Joel] and
> start by simply using some of the procedures.  Little
> more than a RSTLIB and some /copys and you are suddenly
> livin' in ILE-land.  Once you are comfortable using
> them you really aren't that far from writing them.

Some excellent advice!  You can also look at the iSeries-toolkit for
examples of subprocedures.  http://www.iseries-toolkit.org.

> And Buck, isn't "viola" french or italian for "ta-da!"?

The French word would be voilà!  The viola is a 4 stringed orchestra
instrument which looks like a violin but is deeper and richer in tone.  We
often play harmony with the 'cellos, although the 'cello players among us
might have a different opinion!  :-)
  --buck




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.