× 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: Douglas Handy <dhandy1@xxxxxxxxxxxxx>
  • Date: Tue, 02 Jan 2001 10:31:51 -0500

David,

>I have always been fond of
>ADD 1 CYOORD
>
>That one has worked since 196x...

Actually, it didn't work in the '60s or even the '70s, and that is part of the
point.  When I first started with RPG II in 1979, factor 1 was not optional,
thus you wrote:

      C           CYOORD    ADD  1         CYOORD

As I recall, it wasn't until after RPG III on the S/38 that factor 1 became
optional in RPG II -- it may have the last release or two on the S/34, or more
likely one of the S/36 releases.

And I always *did* prefer to leave factor 1 blank when it matched the result
field.  Not so much because it was less typing (not a big deal), but because it
was easier to read during maintenance -- you didn't have to examine the field
names to make sure they matched.  RPG field names (At least then) tended to be
somewhat cryptic, and it is/was all too easy to "read over" a single character
difference.

So to me  RESULT += FACTOR2  *is* the equivalent of:

      C                     ADD  FACTOR2   RESULT

whereas RESULT = RESULT + FACTOR2 is the equivalent of the old:

     C           RESULT    ADD  FACTOR2   RESULT

I'd welcome this change, just as I did making factor 1 optional.  Not because it
saves typing, but because it makes "reading" source easier during maintenance.
I suspect this will be less of an issue as more programs have "real" variable
names which are longer than 6 characters.  But OTOH, that may make one even less
prone to pay close attention to when two variables names are extremely similar
but not identical.

I wouldn't spend lots of my $100 for it, but then it didn't cost much either...

Doug
+---
| 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.