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