|
Else comes to mind. In RPG I would probably put the rest of the code in a subroutine (No not a function) and only execute the subroutine : if Not (isNonStoreAccnt(rs.getInt("CORPCONS"),rs.getInt("STORE"))) ExSr subroutine ... Duane while (rs.next()) { if (isNonStoreAccnt(rs.getInt("CORPCONS"), rs.getInt("STORE"))) { continue; } if (firstTime == 'Y') { ...code... firstTime = 'N'; } if (rs.getInt("CORPCONS") != savCorpCons) { ...code... } if (rs.getInt("DIV") != savDiv || rs.getInt("SUBDIV") != savSubDiv || rs.getInt("PRDDIV") != savPrdDiv || rs.getInt("PRDSUBDIV") != savPrdSubDiv) { ...code... } } // End While Loop Here is how my professor would have coded it: while (rs.next()) { if (isNonStoreAccnt(rs.getInt("CORPCONS"), rs.getInt("STORE"))) { continue; } if (firstTime == 'Y' && isNonStoreAccnt(rs.getInt("CORPCONS"), rs.getInt("STORE")) != true) { ...code... firstTime = 'N'; } if ((rs.getInt("CORPCONS") != savCorpCons) && isNonStoreAccnt(rs.getInt("CORPCONS"), rs.getInt("STORE")) != true) { ...code... } if ((rs.getInt("DIV") != savDiv || rs.getInt("SUBDIV") != savSubDiv || rs.getInt("PRDDIV") != savPrdDiv || rs.getInt("PRDSUBDIV") != savPrdSubDiv) && isNonStoreAccnt(rs.getInt("CORPCONS"), rs.getInt("STORE")) != true) { ...code... } } // End While Loop _______________________________________________ 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. NOTICE: This electronic mail transmission may contain confidential information and is intended only for the person(s) named. Any use, copying or disclosure by any other person is strictly prohibited. If you have received this transmission in error, please notify the sender via e-mail.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.