|
Customize the Tab Key in WDSc
Published: February 28, 2007
by Jon Paris
One of the things I like about WebSphere Development Studio Client (WDSc) is having the ability to use the Tab key to move through an RPG spec without having to prompt as I would in SEU. But it is WDSc's ability to customize the tab key behavior that I really like.
To change the standard tab settings, open the Preferences dialog from the Windows menu pull-down and then drill down to Remote Systems --> iSeries --> LPEX editor parsers -> ILE RPG as shown below:
Notice the "User Defined Tabs" check box. Once this is selected the tab settings area below it becomes active. In the example I have selected the Definition spec. Notice that each tab position is marked by a circumflex (^) symbol (a.k.a. a "hat" or "caret" to most of us). Setting up your own custom tabs is simply a matter of positioning the circumflex symbols in the right spots.
In the screenshot below, you can see my customized settings. Some of the positions may surprise you so I will briefly explain the thinking behind the choices after you take a look.
- The first tab stop after the "D" is at the second character in the name area. When we designed the RPG IV language at IBM, we were foolish enough not to leave a gap between the D and the name. As a result, in many programs the variable names look really horrible because they all start with a D! (For example DcustNum, DdiscountCode, Daddress, etc.) So I always start the name in the second position.
- Most of the time, I am defining fields within data structures, so the next tab stop is at field length. Since most field lengths will be either one or two digits, the tab stop is at the second to last position. When defining a stand-alone variable or a data structure, I simply use the mouse to position the cursor.
- My next stop is at the second position of the decimal places area. When was the last time you defined a field with more than 9 decimals!
- The keywords area is next, followed by comments--although I rarely if ever use that area, preferring to use line comments instead.
Once the changes have been made, all that remains is to push the "Apply" button and you are done. When you return to your edit window, the new tabs will be immediately in force.
Although these days I do the vast majority of my coding in /Free, I also make similar changes to my C specs (among others) as you will see in the picture below. Since I can't remember the last time I used the level break and indicator areas, and rarely use Factor 1, the first stop is at the Opcode. Next stop is Factor 2 and, apart from the comment area, that's it.
I also occasionally use fixed form calcs for teaching purposes, so that format is similarly customized with stops at the Opcode, Factor 2, and Result only. After all, we wouldn't want to encourage anyone to use those nasty length definition or resulting indicators, now would we?
Once last point before I close. For some strange reason, the current version of WDSc seems to go off into la-la land for a while if you insert a large number of spaces to position a tab stop. I have found things work more smoothly if I delete unwanted stops and then insert spaces to reposition the remaining stops.
Jon Paris is one of the world's most knowledgeable experts on programming on the System i platform. Paris cut his teeth on the System/38 way back when, and in 1987 he joined IBM's Toronto software lab to work on the COBOL compilers for the System/38 and System/36. He also worked on the creation of the COBOL/400 compilers for the original AS/400s back in 1988, and was one of the key developers behind RPG IV and the CODE/400 development tool. In 1998, he left IBM to start his own education and training firm, a job he does to this day with his wife, Susan Gantner--also an expert in System i programming. Paris and Gantner, along with Paul Tuohy, are co-founders of System i Developer, which hosts the new RPG & DB2 Summit conference. He can be reached at jon@systemideveloper.com.
Post this story to del.icio.us
Post this story to Digg
Post this story to Slashdot
|