× 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: Right side comments
  • From: boothm@xxxxxxxxxxx
  • Date: Wed, 25 Jul 2001 11:13:39 -0400


Egad man, thousands of lines between IF & END?  Even in RPG III you can make subroutines as you go.

But I've found right-side comments are especially useful if one is using 132 column emulation.
----------------------------------------------------------------
Booth Martin, 802-454-8315 x235
Goddard College Information Services
http://www.Goddard.edu
----------------------------------------------------------------



Buck Calabro <Buck.Calabro@commsoft.net>
Sent by: owner-rpg400-l@midrange.com

07/25/01 10:15 AM
Please respond to RPG400-L

       
        To:        RPG400-L@midrange.com
        cc:        
        Subject:        Right side comments



Right side comments do have value if used judiciously.  In the RPG III
world, I used to use right side comments in the C specs, but only for COMP,
IF/END, DO/END SELEC/WHEN/ENDSL etc. groups.  

    C           DDD       IFGT RPTDAY                     > RPTDAY
    C                     SUB  1         YY                        
    C                     ADD  365       DDD                      
    C                     END                             > RPTDAY

I find that there is just too little room for a "real" comment, but much of
the RPG III code is so monolithic that there can be hundreds or even
thousands of lines between the IF and the corresponding END, so the right
side comments can help there.  I believe that having a mnemonic rather than
a "how deep are we nested" number is more useful because sooner or later,
that code will get an extra IF or have one taken out, and then the comments
are out of whack with reality.  Further, scanning on 0001 will turn up way
too many false hits, whereas "> RPTDAY" will only find my two places.  It is
actually useful to add this sort of right side comment when going in to
legacy code for the first time.

In the RPG IV world, when I'm visiting code like that (many lines between IF
and END) I have a very strong tendency to make the interior code a
subroutine (with a nice long descriptive name) so that I can see the
decision point and the action on the same editor screen.

C     DDD           IFGT      RPTDAY          
C                   exsr      decrJulianYear  
C                   END                      

C     decrJulianYearbegsr                      
C                   SUB       1             YY
C                   ADD       365           DDD
C                   endsr                      

Buck Calabro
Commsoft; Albany, NY
Visit the Midrange archives and FAQ at http://www.midrange.com
+---
| 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.