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


  • Subject: Re: Clever UNIX/C Constructs
  • From: John Hall <jhall@xxxxxxxxxxx>
  • Date: Thu, 04 Jan 2001 14:22:04 -0500



boldt@ca.ibm.com wrote:
> 
> This debate is still raging?!?

nah - more like simmering ;)
> 

> Actually, the listed price is $10.  But it probably should have been
> listed as $2.  I wouldn't say it's a "lunch-time diversion", but it's
> not much work at all.  In fact, I have it working already in my own
> development library!  The only work remaining is a diagnostic or two,
> and testing.  (Oh yeah, also writing up the description of the
> function.)
> 
> So the question of whether or not this should be implemented is, as
> far as I'm concerned, moot.
> 
> Also, it's not the same as ADD.  Using +=, you can code stuff like:
> 
>        string += ' ' + productCode;
>        total += cost + tax;
> 
> You can't do that with ADD.
> 

True - I was think about adding a single value - not multiple.  Of
course another good reason to use it.

> 
> And maintainability.  As others have pointed out, if you're
> incrementing some complex expression, it's easier to get it right
> if you only have to type it once.
> 
> Oh yeah, also performance.  Consider the statements:
> 
>       Totals(FindItem('xyz')) += incr;
>       Totals(FindItem('xyz')) = Totals(FindItem('xyz')) + incr;
> 
> One statement calls procedure FindItem once, the other twice.
> You just might find some use for this.
> 
> > Indicator logic may be a poor example since newer versions of RPG are
> >eliminating them.  But I would like to see some of the better features
> >of RPG added back into C
> 
> I'm curious - could you name some RPG things you'd like to see in C?
> (Besides, of course, better string manipulation.)

Well try writing a report program in c.  To do it right you will end up
with a library of functions to handle what is built into RPG.  Not that
a library of functions is a bad thing but each implementation of c will
handle printer output a little differently  (DIPLOMAC vs IBM c - both on
an AS400)

> 
> BTW, we're not eliminating indicators, just making them less
> necessary.
> 

Of course that is what I meant to say.

> Here's another take on this argument.  Much of what we've been doing
> to the language in the past few releases has been to relieve the
> programmer of having to deal with those existing quirks.  I would
> argue that a program written to take advantage of the V5R1 language
> would be much more maintainable than more traditional RPG programming
> style.
> 

I agree.  RPG IV is much easier for non RPG programmers to learn.  Using
%eof, %error etc is a hundred times clearer than using right hand
indicators on a read statement.

John Hall
+---
| 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 ...

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.