|
I've taken my cue from the way Code/400 handles it on conversion, here's a snippet or two: AID = 'A'; Chain PB1list PBRACCT1; If NOT %found; Close PBLACCT1; Return Error; EndIF; pa_STATUS = 80; pa_SUSPOPID = UserName; pa_SUSPCODE = 50; pa_ACODE = #PB_SRV(pa_COMPANY:pa_SYSTEMID:pa_ACCOUNT#:pa_KEYDATE :pa_SEQUENCE:pa_BALANCE:pa_TRANCODE); w_UTC = #RtvUTCoff; If utcSign = '+'; pa_SUSPENDED = (%timestamp - %hours(utcHH)) - %minutes(utcMM); Else; pa_SUSPENDED = (%timestamp + %hours(utcHH)) + %minutes(utcMM); EndIF; Update PBRACCT1; // write transaction TranTime = #LogIt(90:CMPY:SYID:CRD#:ACCOUNT:TYPE:PROMO:pa_BALANCE); Error = '0'; If %open(PBLACCT1); Close PBLACCT1; EndIF; Return Error; /end-free P #PBsuspend E .... // Run the Ring(s) SetLL CMPY MPRMPP1; DoU forever; ReadE CMPY MPRMPP1; If %eof; Leave; EndIF; // Run the Ring Members SetLL mp1_RINGPF MPRMPP2; DoU forever; ReadE mp1_RINGPF MPRMPP2; If %eof; Leave; EndIF; If mp2_CMPYPF <> CMPY; Chain VD6list MPRVND6; If %found(MPLVND6); If ACCPVD <> 'X'; DELTVD = 'X'; DDELVD = h_today; UDELVD = UserName; DEBPVD = CMPY; Update MPRVND6; // write transaction TranTime = #LogIt(75:CMPY$$:SYID:CRD#:ACCOUNT:TYPE:PROMO :AWD$VD); FoundOne = 'Y'; EndIF; EndIF; EndIF; EndDO; EndDO; The only thing I'm doing so far is that on continued lines of parameters I start with a ":" on the next line rather than end with it on a line. This helps (slightly) my tired old eyes finding the lines that need to end with the #$%^& ";" when the program won't compile. I'm not enamored of the // for comments, but it's no big deal as I scarcely use them, figuring if you can't read RPG get the #$%^ out of my program. :-) Other than that it's an evolving, fluid standard. Like all the others. :-) BTW, if you're using CODE/400 for v5r1 be sure to try the Action menu, Convert to C free form. It and Compare (and for fixed form RPG, the Indent function) are well worth the price of admission IMHO. The convert really highlights the 'bad' stuff by bracketing it in /END-FREE and /FREE lines. -----Original Message----- From: James Rich [mailto:james@eaerich.com] Sent: Wednesday, October 10, 2001 12:23 PM To: rpg400-l@midrange.com Subject: Re: Free-form RPG standards On Wed, 10 Oct 2001, Smith, Nelson wrote: > Has anyone adopted or seen any good examples of "Standards" yet on how > free-form RPG should look? We're going to V5 pretty soon now and I need to > head off the inevitable coding wars that are sure to ensue. Something like > the "Style" chapter in Jon's redbook would be great. How about following more or less the way the C beautifier indent does it? It doesn't do anything about capitalization but it does handle spacing and indentation. Makes function definitions, calls, etc. look nice and easy to read. I think free form RPG should be similar to other free form languages in terms of "look and style". James Rich james@eaerich.com _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.