× 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: Structured RPG ? - Was ITER/LEAVE
  • From: "Stone, Brad V (TC)" <bvstone@xxxxxxxxxxxxxx>
  • Date: Tue, 28 Apr 1998 11:14:52 -0500

Nice to see someone who uses parenthases like I do!  I was taught in a
language other that RPG where boolean logic and operation precidence
makes a difference (or at least we were taught that it did).

I would use the same as you stated, except I do put more than one
comparison per line.

if      x = 1
if      (x = 1)

Sure, these will both do the same, but the second is much more readable.
Face it, RPG is finally catching up with the languages of the 80s
(Pascal, ModulaII) and it's time to relearn, I guess.

Then again, what do I care what you do, I'll never work on your code!
hahah....  Do what you want...

Bradley V. Stone        
bvstone@taylorcorp.com
http://prairie.lakes.com/~bvstone/
"Robble Robble" - The Hamburgler

> -----Original Message-----
> From: ericadelong@pmsc.com [SMTP:ericadelong@pmsc.com]
> Sent: Tuesday, April 28, 1998 9:27 AM
> To:   MIDRANGE-L@midrange.com
> Subject:      Re: Structured RPG ? - Was ITER/LEAVE 
> 
> 
> John, 
> 
> IMO, I'd prefer the following:
> 
>                 IF          ((Amt_Due >0) and 
>                              (Payment >0) and        
>                              (Chk_Amt >0))
> 
>                 exsr        Do_Payment
>                 ENDIF
> 
> The only real difference from your last example is just presentation.
> To me, the
> use of symbolic shorthand in logical constructions is confusing and
> potentially 
> dangerous. I also prefer to code only one boolean op on a line so that
> the 
> expression can be changed/added to without needing to cut and paste to
> make the 
> changes fit.
>  
> Just my opinion......
> Eric A DeLong
> ericadelong@pmsc.com
> 
> ______________________________ Reply Separator
> _________________________________
> 
>      
> Hi all
> I think these are both examples of "What would you do if you  were in
>  a dark alley, in a bad section of town, and ....."
>      
> There is no good answer.   You have to look back upstream for the
> answer. 
> Why do you have three Indicators defining some condition as variable 
> flags.   The structure and read-ability has already been compromised. 
>      
> Can either one of the above provide lucidity on whats going on there??
> 
> Is there more information about the decision being made than is being 
> shown?
>      
> Curious, Which one of these is more readable?? Whats everyones
> opinion? 
>      
> -----------------------------------------
>         Amt_Due                IFGT        0        
>         Payment                ANDGT        0 
>         Chk_Amt                ANDGT        0
>                         EXSR        Do_Payment
>      
>                         Endif
>                         Endif        
>                         Endif
>      
> or this --------------------------------------------------
>      
>                         IF        ((Amt_Due >0) + (Payment >0) +
> 
>                                  (Chk_Amt >0))
>      
>                         EXSR        Do_Payment
>                         Endif
>      
> With writing it one of these ways,  Not only do you know that
> something 
> will be done if these three conditions are true,  BUT you also know
> this 
> is most likely dealing with money and something to do with payments.  
>      
>      
> These add tremendous leveraging power to the Maintenance/Enhancement 
> capability of your staff as well as the application base.
>      
> Things won't break as often from a mis-diagnosis of the problem and
> have 
> the fix break more than the fix.
>      
> Just Curious.  Which of the 4,  people like better?
>      
> John Carr
>      
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to MIDRANGE-L@midrange.com.
> | To unsubscribe from this list send email to
> MIDRANGE-L-UNSUB@midrange.com. 
> | Questions should be directed to the list owner/operator:
> david@midrange.com 
> +---
>      
> 
> 
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to MIDRANGE-L@midrange.com.
> | To unsubscribe from this list send email to
> MIDRANGE-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
> david@midrange.com
> +---
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.