|
One line - looping (curved - will never intersect) * _ * _ * | / | / | v / v / v */ * / * opps - he said - two dimensional - oh well - nice try Jeff Stevens Mize, Houser & Co. P.A. 913 451 1882 JStevens@xxxxxxxxxxxxxx MWalter@xxxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/01/2005 03:21 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject RE: RPG read loops Sorry, Starting top center dot. Is this what you had in mind or did I mis-read the 'documentation'. What did you intend? :-) I must say, I've seen better documentation in Mapics programs. LOL Thanks, Mark Mark D. Walter Senior Programmer/Analyst CCX, Inc. mwalter@xxxxxxxxxx http://www.ccxinc.com MWalter@hanoverwi re.com Sent by: To rpg400-l-bounces@ RPG programming on the AS400 / midrange.com iSeries <rpg400-l@xxxxxxxxxxxx> cc 02/01/2005 04:14 Subject PM RE: RPG read loops Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> *--------->*--------->* ^ | | | v v *<---------*<---------* Thanks, Mark Mark D. Walter Senior Programmer/Analyst CCX, Inc. mwalter@xxxxxxxxxx http://www.ccxinc.com "Bob Cozzi" <cozzi@xxxxxxxxx> Sent by: To rpg400-l-bounces@ "'RPG programming on the AS400 / midrange.com iSeries'" <rpg400-l@xxxxxxxxxxxx> cc 02/01/2005 03:54 Subject PM RE: RPG read loops Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> Oh, and each dot on the top row must be connected with each dot in the bottom row, in case that wasn't clear. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bob Cozzi Sent: Tuesday, February 01, 2005 2:39 PM To: 'RPG programming on the AS400 / iSeries' Subject: RE: RPG read loops Yes there is a better way... I will only tell you the answer, however, after you send me a diagram illustrating how, in the figure below, to connect the top row of 3 dots with the bottom row of 3 dots using a line drawn with a pen or pencil WITHOUT ever allowing any of the lines to intersect. This has to be accomplished on a two-dimensional surface. You have ten minutes... Go! * * * * * * -Bob Cozzi -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Paul Morgan Sent: Tuesday, February 01, 2005 2:27 PM To: rpg400-l@xxxxxxxxxxxx Subject: RPG read loops Almost all of the code in the current Leave / Iter thread showed a loop like: DoU F3 or F12 exfmt If Not (F3 or F12) // do something EndIf EndDo This only has one exfmt statement inside a DoU loop. A similar file read loop would be: DoU %EoF Read If Not %Eof // do something EndIf EndDo which has one read statement inside of a DoU loop. Isn't there a better way of coding loops with more than one read/exfmt like: exfmt DoW Not (F3 or F12) // do something exfmt EndDo or Read DoW Not %Eof // do something Read EndDo or SetLL ReadE DoW Not %Eof // do something ReadE EndDo Most programmers seem to code with the single read/exfmt style which IMHO complicates the code. In a DoU/Read loop the body of the loop is nested two deep inside the DoU and an If statement. In a Read/DoW/Read loop the body of the loop is nested one deep inside a DoW. Doesn't this reduction in the nesting of the body of the loop improve the program? Readability is improved. Performance is also improved (although minor) with the removal of one test against the end of loop. Other programmers I work with are adamant about not coding more than one read statement. Why is coding more than one read statement such a problem? Paul -- Paul Morgan Senior Programmer Analyst - Retail J. Jill Group 100 Birch Pond Drive, PO Box 2009 Tilton, NH 03276-2009 Phone: (603) 266-2117 Fax: (603) 266-2333 -- 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. -- 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. -- 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. -- 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. -- 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.
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.