IBM RDi can help you work faster. But you can't just start using it and expect to experience huge increases in productivity. You have to know how to get the most out of this tool.
I use the following "tips" every day to increase my productivity.
The Outline View
Using the outline view allows you to navigate source quickly and accurately. Jump to the start of subroutines by clicking on them, or expand them to find all lines of code with an exsr for that subroutine.
You can do a similar thing with fields: the top level displays the definition of the field, and you can expand it to see all references to the field. Click on each to jump to the corresponding location in the source. You should be using the outline view (read more).
Do you find yourself writing the same boilerplate code over and over? You probably do, even if you are not consciously aware of it. Ever written a new subroutine? The begsr, endsr and a comment line to describe the subroutineís purpose are three lines of code already. The subroutine snippet Iíve added to my code snippets comprises eight lines as Iíve included extra blank lines and comments for formatting.
That's eight lines I no longer have to type in manually, or copy from another begsr (once I've found one). Read more.
A Record Of Everything Iíve Worked On
In my objects view Iíve created a member filter for every project Iíve worked on since I installed RDi, however small the project. Iíve named each filter very descriptively and specified every source member involved in the project, so if ever I need to remind myself what I did on a particular project last year, I can quickly find out. Itís much quicker than rifling through my often misleading and obstructive notes.
Edit Two Versions Of The Source At The Same Time
Having two versions open of the same source in their own windows is a useful mimic of the SEU F15 browse option. But in RDi you can make changes in both versions! Often I have found myself editing free format code in one window while my other window shows the D specs for reference purposes, and then Iíll make a change to a D spec while Iím there. Changes in one window are reflected in the other window. Using two windows simultaneously like these saves you from jumping around the code erratically in the same window.
In Source Verification
At compilation time In the past, after you have made your changes to a source member in SEU, you will typically have done the following:
- F3 to exit
- Press Enter to save
- Option 14 (or other) to compile the source in PDM
- dspmsg to see whether the source compiled successfully
- F13 to get rid of the message
- Press Enter to return to PDM
- Edit the source again, because it somehow failed to compile
- F15 to browse the spooled file containing your compile listing
- Enter 2 (=Spool file), cursor down to F4 on Browse/copy spool file to find and select the spooled file
- Type ďBĒ and press Enter to get to the bottom of the listing
- Find an error
- Search the listing for the error
- After correcting the code, repeat 10 Ė 13.
Phew, I didnít realise how many steps I had brainwashed myself with. Admittedly, I can rattle off the above very quickly, but itís still a lot of unnecessary steps when I could instead use RDi to verify my source for me before a compile, with a fewer keystrokes. All I have to do is press ctrl + v (to verify) and then double click on an error to take me to its place in the code. Read more.
There are many, but these are the ones I use most:
- Ctrl + home and ctrl + end to get to top and bottom of the source, respectively. It beats pressing F10, typing ďtĒ and pressing Enter.
- Ctrl + d to duplicate a line
- Ctrl + backspace to delete a line
- F3 on a subprocedure or subroutine to jump to the subprocedure or subroutine
- Double on a word to select it for copying, as (opposed to dragging over a word in SEU). In fact, many windowsy shortcuts are available - more RDi keyboard shortcuts
- Get RDi to close open statements like select, if. Click Window > Preferences > type in "rpg" and find the following:
Coupling this with the auto indent option above is a big time saver. You type an "if" and press Enter, and you automatically get a matching "endif" with a blank line in between, already indented and ready for you to start typing your code.