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



How about the situation where you need to do the same thing with several
differently named fields of the same data type like monthly values in a
bucketed record.  In RPG classic you'd have to write a separate subroutine
for each field, or assign it to a work variable before the subroutine call,
or overlay an array over the buckets, or paste the same code several times
in a monster subroutine.  

It's a small thing to some, but local variables mean you don't have to have
globally unique names for loop counters.  

Procedures that return an indicator value are very handy for the situation
where you need to have something pass each of a series of complicated
logical tests.  In RPG classic you'd end up with a long chain of nested if
statements.  If each test is in a procedure you can just say if proc1() AND
proc2()... and rely on short circuiting to take care of it.

If you write a file read procedure that returns an indicator value, you can
put the read in the loop control statement and end (heh heh) the dow and dou
war once and for all.  

I tried to come up with some selfish reasons. 

 -----Original Message-----
> From: Jim Langston [mailto:jimlangston@conexfreight.com]
> Sent: Wednesday, June 20, 2001 3:40 PM
> To: RPG400-L@midrange.com
> Subject: ILE Propoganda
> 
> 
> There is another programmer in the company who has been asked to
> do all new coding using ILE.
> 
> I am working on a program, and making all my new Subroutines into
> Procedures (leaving the old ones alone for now).  He called me
> about a program change he was doing and I mentioned that I was
> adding new procedures into this program, and that he should look
> at how they are done so he knows how to do them.  
> 
> I explained, briefly, how they work, and went, briefly, into the
> difference between coding them in the source, coding them in a
> module, binding to the module or creating a service program, etc..
> 
> His comment, "It sounds awfully complicated, so why not just create
> a program and call the program?
> 
> There are many answers to this, but what is the "correct" answer?
> 
> Calling a procedure coded inside a program should take no more time,
> or even a bit more time, then calling a subroutine, clock cycle wise.
> It is not easy to explain the advantages of a Local variable 
> to someone
> who has has coded straight top down RPG exclusively.
> 
> Any suggestions as to how I can explain the advantages of using ILE
> concepts to such a programmer?
> 
> Regards,
> 
> Jim Langston
> 
> Me transmitte sursum, Caledoni!
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.