|
>Date: Thu, 09 Mar 2000 15:39:27 -0600 >From: Gary Guthrie <GaryGuthrie@home.com> > ... > >Here's a couple of examples code snippets. You tell me which is more >intuitive as you're just reading through code. > >Example A: > ... >C When RtnCode > 0 > ... >Example B: > ... >C When RtnCode = ExistingCust > ... >Maybe we need an IS construct. (Example C) > >C When RtnCode Is ExistingCust > ... There are 2 things needing to be expressed here: 1. The return code represents an existing customer (ex. B and C do this well) 2. The return code is being compared to a class of return codes, not an exact return code (ex. A and C do this well) I agree that RtnCode > 0 is not ideal, but a line of documentation can help. To make it self-documenting, it could be expressed this way (and also allow for any number of classes of return codes): --------------------------------------- | When RtnCode >= minExistingCust and | | RtnCode <= maxExistingCust | --------------------------------------- but I think I'd rather go with either of these which (I think) express exactly what is happening: --------------------------------- | When isExistingCust (RtnCode) | --------------------------------- or ------------------------------------------- | When rtnCode = ExistingCust | | Select | | When extraRcInfo = accountExpired | ------------------------------------------- express exactly what is happening. Barbara Morris +--- | 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 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.