× 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.



Why not
       Select;
        Where CM='CM';
         Memo = '* CREDIT';
         PoNo = *Blanks;
        Where CM='DM';
         Memo = '* DEBIT';
         PoNo = *Blanks;
       EndSL;
And do away with the numerous EndIf's I see in many code samples?

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



                    Jim Langston
                    <jlangston@celsin       To:     "'rpg400-l@midrange.com'" 
<rpg400-l@midrange.com>
                    c.com>                  cc:
                    Sent by:                Fax to:
                    rpg400-l-admin@mi       Subject:     RE: Sanity check
                    drange.com


                    01/09/2002 05:37
                    PM
                    Please respond to
                    rpg400-l






RPG II code saying, If CM contains 'CM', move '* CREDIT' to MEMO,
and *BLANKS to PONO.  If CM contains 'DM', move *BLANKS to PONO
and '*  DEBIT' to Memo.

Same thing in RPG IV following same logic:

/free

       Clear   Memo
       If      (CM = 'CM') Or (CM = 'DM')
       If      (CM = 'CM')
           Memo = '* CREDIT'
           PoNo = *Blanks
       Else
           PoNo = *Blanks
           Memo = '*  DEBIT'
       EndIf
       EndIf

/endfree

I've seen lots of this type of code, and the thing you have to remember,
RPG II at one point didn't seem to have an Else If type statemnent, so
this type of thing was used.

In more Modern Format:

/free

      If   (CM = 'CM')
          Memo = '* CREDIT'
          PoNo = *Blanks
      Else If (CM = 'DM')
          Memo = '*  DEBIT'
          PoNo = *Blanks
      EndIf
      EndIf
/endfree






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.