Version 9.6 of RDi provides a wealth of enhancements and new features; this article introduces some powerful new editor functionality.
RDi is a fantastic tool for RPG development. Since its earliest days as WDSC (or however you choose to capitalize the acronym), the Eclipse-based development suite has been one of the premier productivity tools for IBM midrange developers. While the road has had a few bumpy little detours, each step along the journey has been better than the previous one, and version 9.6 is no exception.
By the time you read this, version 9.6 (and its contemporaneous initial fix pack, 188.8.131.52) will have been available for at least a couple of months, plenty of time for the kinks to get worked out of the delivery system. It wasn't entirely a bed of roses; many people reported problems with the various methods of product access. I can't corroborate the problems; as I usually do, I went with the tried and true method of downloading the entire thing locally and manually adding the images to my Installation Manager repository list. I've found this to be the best way to get and install the software.
While I personally find installing via Installation Manager to be the most foolproof method, if you're not familiar with IM, you may want something a bit more automated. IBM realizes this and even provides a web page with detailed instructions showing how to download the latest version of RDi as a trial version entirely from the web. For newcomers to RDi, this might be the easiest way to get started.
However you go about obtaining the software, though, you'll eventually have to get a license key (an activation kit in Rational parlance), and that means a trip through either Passport Advantage or Entitled Systems Support. This can definitely be a project. Make sure you talk to whoever gets your licensed OS media (if it's not you!); you'll need their credentials to get the activation kit.
A Look at Some of the Enhancements
If you're a first-time user of the Rational tooling, you may wonder about the next few paragraphs. In fact, when I describe some of the new RDi enhancements, you may think this is nothing different from what you've been used to with IDEs from other vendors. But in a way that's one of the real accomplishments of recent releases; between the new syntax for free-form RPG and the ever more industry-standard behavior of the editor, RDi is making RPG look like any other language, and to me, that's a good thing.
So let's get started, shall we? For me, the first standouts are the new annotations and the hover enhancements. Annotations are little icons in the left column of the editor pane that provide information, usually indicating something that needs to be done. The hover enhancements provide extra information when you hover your cursor over a symbol in the code.
The primary annotations center on unused variables and on errors. The unused variables annotation is a welcome addition to program cleanup efforts. One of my jobs is reviewing and modifying old vendor code that has a lot of generated definitions that aren't used. When RDi finds a variable that isn't referenced in the program, it annotates that variable like this:
Figure 1: The i in the left column indicates that more information exists.
The small blue letter i indicates that there's an informational message associated with this line of code. To find out more, just hover over the line as so:
Figure 2: Hovering over the i causes the detailed message to appear.
The system will tell you that the field "unused" is indeed not used. This may mean that you truly haven't used it (so you can delete it), or maybe you did reference it elsewhere but misspelled it. Either way, you are alerted to the condition before you try a compile.
The other annotation has to do with errors. If you have a syntax error in your program, the editor's reaction in previous versions of RDi was to add a bunch of ugly magenta lines to the source detailing the error. It definitely brought attention to the error, but it could also be a bit clunky. The new technique is cleaner and more in line with modern techniques. First, the error is annotated:
Figure 3: Syntax errors are shown with a different annotation.
The small red circle with a white X indicates an error. As with other annotations, hovering over that symbol brings up the error in detail:
Figure 4: Hovering over those errors works the same, showing the detailed message.
In this case, what I did was leave out a colon between two parameters, and as you've probably found, this usually creates multiple errors. The hover is able to show all of those errors. The text in the hover is what you would normally have seen inline in the source in previous versions. This behavior is available for both syntax errors and compiler errors.
The annotation is a good introduction to hover in general. As you can see, the tool is moving toward a visual interface that has less clutter but brings up more information as you hover over things. In keeping with this visual assistance, IBM has provided a number of hover enhancements for other components of your source code. To start with, variables provide their entire provenance. Figure 5 shows an example:
Figure 5: Hovering over a variable shows its detailed definition.
This field happens to come from a display file. I like that it shows the external file, the record format ,and finally the field name. This really helps me keep track of exactly which data points I'm using at any point in the program.
Another hover enhancement comes when we hover over a call to a reference to a prototype. In this case, I have a prototype for the ILE function system. When I hover over a call to that prototype, I see the entire definition of that prototype pop up for review.
Figure 6: Hover over a reference to a prototype to get its definition.
In this particular case, the prototype is defined right in my function, which is good because it shows you that the hover box identifies not only the definition but also the immediately preceding comment. This is really important, especially when you have many prototypes and they're interspersed throughout your program or brought in via /COPY.
This also works on local procedures. You don't even need a prototype for those; simply hover over the definition.
Figure 7: Hovering over a call to an internal procedure brings up the definition the same way.
Hovering has a lot of great capabilities. I particularly like the fact that it brings in the comments along with the definition; this really makes comments more valuable and perhaps gives us more reason to create and maintain them.
A Preview of What's to Come
IBM packed a lot more functionality into this release, from simple things like space-saving UI changes (especially nice for those with smaller monitors) to completely new features. The latter includes "new to me" features like Code Coverage, a subject to which I hope to devote an entire article after I learn a little more. This really is a feature-filled release, and I can't wait to share more of it with you!