|
|
I have written several articles with tips on how you can make IBM WebSphere* Development Studio Client (WDSC) more efficient. You can find them by searching for my name at the IBM Systems Magazine Web site (www.ibmsystemsmag.com). I also taught a WDSC Tidbits of Goodies session at COMMON in April and appreciate those of you who made it there. You can expect more great tidbits in this magazine and on its Web site in the coming months. The following four tips on WDSC are my continuation of strategies to justify the existence of WDSC on your desktop.
i5/OS* V5R1 presented what has probably been one of my all-time favorite features of RPG: /Free format calc specs. When /Free form came out, I was flirting with Java*, so when I learned I could write my RPG in a similar fashion, I was ecstatic. To paraphrase a great man with a Mohawk and gold jewelry, “I pity the fool who still codes in fixed!”
We’re all able to code in /Free form, right? If you aren’t, there’s an incredibly easy way to learn the syntax because WDSC has a feature letting you easily convert code to /Free form. In the live parsing and extensible (LPEX) editor, simply highlight the code you want converted, right-click it and select “Convert Selection to Free-Form” from the list that appears. Figure 1 (right) shows before-and-after images of the same set of code.
Note the automated converter isn’t perfect, but then I wouldn’t necessarily expect it to be.
For example, because of a MOVE opcode’s potential to hideously alter data, the converter simply leaves that portion of code in fixed format because no /Free form equivalent exists.
One feature I use at least a handful of times with each open-source member is the LPEX editor’s find-and-replace functionality. I should note that the LPEX find-and-replace capabilities are second to none—even when you consider the Java editor’s equivalent. The best part about the LPEX find and replace is it doesn’t open a dialog box but simply places a small form at the bottom of the editor to enter parameters as shown in Figure 2.
To bring up the find-and-replace dialog easily, use the keyboard shortcut Ctrl+F. The cursor is placed in the Find box letting you immediately start typing the value you’re searching for. The cool thing is that as you type it’ll incrementally search the source with each additional character until you stop typing. I’ve found this useful in cases where I only know part of a variable’s name. While your cursor is in the Find text box you can use the up and down arrow keys to scroll through a list of previously searched-for strings. Once you’ve found the instance of the string you’re seeking, use the Esc key to close the find dialog and return to the editing area.
Note that regular expressions are also a feature here that makes the find-and-replace capabilities incredibly fine tunable.
To invoke the replace functionality, put a value in the Replace text box and select either the Replace or Replace all button. For the most part, I use the singular Replace button because I want to ensure it’s modifying the code as I expect. This approach takes longer because I replace values one at a time, but it saves me time in the long run.
Every once in a while, I run across code that doesn’t have all of the specifications in column six in the same case (i.e., there’s upper- and lowercase). Some days this just drives me nuts and causes constant distraction. So instead of putting up with it or trying to ignore it, I simply employ the flexibility of find and replace and search for a particular specification (say D-spec) and do a replace for every D-spec in column six to be capitalized regardless of its current case. Figure 3 gives an example of how this can be accomplished.
One of the last neat features I enjoy is the All button shown in Figure 4 (page 50). When clicked, it’ll search and find all instances of the text string in the document. This creates expandable sections that let you more easily perform quick scans of the source, place your cursor on a particular instance, and then select Ctrl+F5 to expand all sections yet leave your cursor on the instance you previously selected.
I love seeing a lot of code at once. The more I can see, the less I need to use the mouse.
Page 1 2
Browse products and services for Developer.