|
I must be in a hurry today... Please replace 'making code understandable and "dumbing-down"' with 'making code understandable _vs._ "dumbing-down"' -----Original Message----- From: Bale, Dan [mailto:DBale@TFSA.Textron.com] Sent: Friday, February 25, 2000 5:17 PM To: 'RPG400-L@midrange.com' Subject: RE: Quote Question Now I know how those "blank" replies are mistakenly sent - Sorry for the previous "blank" reply to this message. Albert, You make a good point. I have actually waffled between using a constant (like you and others have mentioned) and just using the doubled-up single quotes. Obviously, I have pretty much committed to the doubled-up single quotes. I think there is a balance, too, of making code understandable and "dumbing-down" to the point that RPG newbies can comprehend what's going on without having to ask what something in the code is doing. I'm happy to answer questions like those, but I realize too that I might not be in this AS/400 shop six months from now. Usually, I will document some non-typical code. Just yesterday, in fact, someone asked me about my code to center text in a field, which uses nested BIFs to accomplish the task. I modified my comments in the code to briefly touch on what was happening and referred the reader to the RPG Reference manual. I'm thinking of collecting these sorts of coding examples into an EXAMPLES document that anybody can refer to in our shop here. Hey, I suffered under band printers, too, and I'm NOT an old fogey! At least I don't think under-40 is old fogey. ;-) Yeah, I remember being burned by the disappearing characters on printouts. I even remember when you printed with an uppercase-only band, the OS wouldn't translate the lowercase to uppercase, and you'd get a mostly blank page with capital letters scattered over it. We thought it was a major advance when IBM automatically handled that (S/36 intro?). - Dan Bale -----Original Message----- From: York, Albert [mailto:albert.york@nissan-usa.com] Sent: Friday, February 25, 2000 4:08 PM To: 'RPG400-L@midrange.com' Subject: RE: Quote Question I agree that maintainable code is just as important as code that works. During the lifetime of a program (which Y2K taught us is much longer than we thought) it will be changed by many different people, all of whom will be looking at the program for the first time. One of the ways to make programs easier to maintain is to make them easier to understand by removing opportunities for confusion. That's why I prefer to use a constant when I want to include a single quote. There's no question about what is intended whereas a double single quote looks an awful lot like a single double quote. <Old Fogey *ON> Back in the bad old days when we used band printers for our listings we had to be careful about special characters as they might not be included on the printer band. Something like VAR1 IFEQ '>' would come out as VAR1 IFEQ ' '. That taught me to err on the side of being more explicit whenever there is any doubt. <Old Fogey *OFF> > -----Original Message----- > From: Bale, Dan [SMTP:DBale@TFSA.Textron.com] > Sent: Friday, February 25, 2000 12:10 PM > To: 'RPG400-L@midrange.com' > Subject: RE: Quote Question > > Um, "it works" and "it's easily maintainable and understandable" are two > completely different animals. ;-) > > Just out of curiosity, why wouldn't you just use the double single quote? > Not just you, chandran, but the rest who use a constant or assigned > variable > like SingleQuote. Surely you can figure out: Eval HeSaid = 'I don''t > care > what it looks like.' > > In the end, I'm sure, this is a case of "whatever works for you". I will > never begrudge anyone of that. > > Anybody remember the old DataNetwork (? precursor to Midrange Computing ?) > magazine and their "shortest possible code" contests to complete a given > task? Those worked, too, and some of the solutions were good teaching > lessons on the "advanced" state of RPG. They ended the contests when it > was > decided that a technical magazine like that should be promoting good > programming style and not "I can write that code in 'n' lines". > > - Dan Bale > > -----Original Message----- > From: chandran balaji [mailto:cbalajivk@hotmail.com] > Sent: Friday, February 25, 2000 2:34 PM > To: RPG400-L@midrange.com > Subject: RE: Quote Question > > > hey it works in all my programs and has in the past years, so i dont see a > > problem. > > Cheers > > > From: "Bale, Dan" <DBale@TFSA.Textron.com> > Reply-To: RPG400-L@midrange.com > To: "'RPG400-L@midrange.com'" <RPG400-L@midrange.com> > Subject: RE: Quote Question > Date: Fri, 25 Feb 2000 13:31:02 -0500 > > chandran, > > With tongue FIRMLY in cheek, please assure me that I will never have to > maintain your code! > > (You had no emoticons in your post, so I'm presuming you were serious.) > > - Dan Bale > > -----Original Message----- > From: chandran balaji [mailto:cbalajivk@hotmail.com] > Sent: Friday, February 25, 2000 12:36 PM > To: RPG400-L@midrange.com > Subject: Re: Quote Question > > > Here is the data struct required > > * Create Aphostrophe Char > D BINARYCVT DS > D BINNBR 1 2B 0 > D BINCHR 2 2A > > Here is the C spec > > EVAL BINNBR = 125 > EVAL WKPOST = BINCHR > > WKPOST will have the Aphostrphy (') then u can use a loop to add it to the > begginig of the string and to the wnd of the string > > > Good luck > > From: "Brian Stapleton" <Brian.Stapleton@diverseylever.com> > Reply-To: RPG400-L@midrange.com > To: "rpg400-l@midrange.com" <rpg400-l@midrange.com> > Subject: Quote Question > Date: Fri, 25 Feb 2000 11:10:00 -0500 > > Greetings All; > > I need to create a text sting that includes a single quote. Any Idea on > how > > to > do this? > > I tried using specifying this on the INZ of a D-Spec and no luck. I tried > doing this also with an EVAL and still no luck. Any help would be > appreciated. > > > > Brian Stapleton > Information Services > DiverseyLever Institutional > A Div of DiverseyLever > Brian.Stapleton@diverseylever.com > (248) 304-3553 > +--- > | 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 > +--- > > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com > > +--- > | 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 > +--- > +--- > | 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 > +--- +--- | 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 +--- +--- | 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 +--- +--- | 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.