|
Ken, >Copying code is great. Why reinvent the wheel? By copying code you can >make the same mistakes over and over almost effortlessly! Cloning code is great -- when it does what you want or at least provides a near template. Perhaps I misunderstood what Rick was suggesting was his usual MO, but I thought he meant he would copy a block of lines just so he could completely overtype them and navigate using ctrl-left/right. I've seen people do that just to avoid insert statement mode in SEU and spacing to the correct column. If he was referring to copying code and only changing the variable names to protect the innocent, then that's a different story. But Flex Edit (and I would suppose CODE?) take this to a new level too. Instead of having to find a section in an existing program, I can setup named templates which can be selected and merged in *very* quickly. Including the ability to first prompt for replaceable parameter(s) and have them inserted in multiple spots in the template. And then automatically move the cursor to a location noted in the template. These can be quite complex, involving large code segments or entire programs. Or they can be simple program or function header comments. Or as simple as a template which inserts SELECT on one line, WHEN on the next line with the cursor placed in factor 2, plus another line with ENDSL added beyond it. In just a couple of keystrokes you're ready to just start typing the case expressions, and you don't have to remember to add the ENDxx when you're done. There's tons of this kind of stuff you can do with an intelligent editor. For example, a CHAIN could prompt for the key, filename, and format name then insert a whole block of code: C key Chain filename C If %error( filename ) C {put cursor or standard error logic here} C Else C If not %found( filename ) C Clear *All format C Endif C Endif or whatever it is you like to do as a standard practice. (And yes, Clear *All does work on input only files in RPG IV...) >Copying code helps to form unofficial standards if you don't have any official >ones... >... So when I copy code I just try to do it from the newest programs >that have the code I want. And that becomes much easier if you just create templates of code fragments you want to be able clone readily. Then as new BIFs or techniques become available, you just change the template repository but don't have to go searching for a program which uses the newest company "standard". Doug
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.