×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Another point is now that RPG is speeding up its features, switching from
language to language isn't such a pain in the butt.  I have been writing a
lot of PHP code lately and it has the += feature and I absolutely love it.
And now that I have a V5R2 machine I can do it in when I code RPG also.

Especially with the 80 column source file limitation, something like this
comes in very handy and can clean up code considerably.  I recommend that
you give it a fair chance and then make an opinion because sometimes as RPG
programmers we dismiss anything that can be considered "like Java" or "like
C" or "like .NET".    

Aaron Bartell

-----Original Message-----
From: Hans Boldt [mailto:boldt@xxxxxxxxxx]
Sent: Tuesday, November 25, 2003 12:18 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Shorthand Syntax (was XFoot with Qualified DS's)


Michael Naughton wrote:

> Call me a dinosaur (and you probably will :-), and I certainly don't mean
> to rain on anyone's parade, but IMHO these are syntaxes which I will
> probably never use.
> 
> On the one hand, we're all grateful for the RPG enhancements that allow us
> to enter nice long variable names, and we're happy that we can now mix
> upper and lower case and give the shift key a workout, but somehow we
> can't abide the notion of having to type:
> 
> a = a + b
> 
> and instead are begging to be able to limit ourselves to
> 
> a += b
> 
> Personally, I don't see the point (won't be the first time ;-).
> 
> JMHO
> 

If RPG operands were limited to 6 character variable names, then there's 
not much need for such a shorthand.

But this is the 21st century. And while RPG may be rather late, the 
language finally has fully qualified names. And so a statement like the 
following is not out of the question:

      cust(cid).division(did).balance(acctno) += payment;

The short-form assignment operator becomes a very useful tool in such 
cases, and may well be clearer (and in fact more correct) than:

      cust(cid).division(did).balance(acctno) =
              cust(cid).division(bid).balance(acctno)
                           + payment;

But as always, YMMV.

Cheers! Hans


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.