• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: RDi V9.6 Part 7 – Zoom in, Know Where You Are, Refactor Constants and More

    May 11, 2020 Susan Gantner

    RDi enhancements just keep coming. Since my last installment in this series on V9.6 there have been more fix packs and quite a few new features. Here in part 7 I’ll cover refactoring character constants, two ways for RDi to indicate “you are here”, and a small but really useful way to zoom in on your code. Plus a small bonus item for those who do their compiles in batch.

    You Are Here!

    Two new features were added in 9.6.0.6 that act a bit like those “you are here” indications on maps. When editing RPG code, it tells you if you’re in the mainline code or what subroutine or subprocedure you’re in.

    The name of the routine or (Main Procedure) appears in the message area at the bottom of the editor window. In addition, you can have the Outline view position itself automatically and highlight the appropriate routine as you move through the code. Both features are illustrated in Figure 1 below.

    Figure 1: You Are Here

    It’s probably a bit overkill to have both of those features active at the same time so decide which works best for you. The message at the bottom of the editor is on by default but can be turned off via an option on the main ILE RPG preference page. (Note that the fastest way to get there is via the Preferences option from the Outline view menu). The option you’re looking for is “Show current procedure or subroutine in editor” near the bottom of that page.

    Just below that option on the preference page is “Select current procedure or subroutine.” That is the one that controls the Outline view action. That preference can also be accessed via an option from the Outline view menu. I believe it is not turned on by default.

    Zoom In

    Sometimes it’s nice to make the source code you’re working on in the editor a bit bigger. Maybe you’re showing something to a colleague looking over your shoulder or maybe you’re just having one of those days when you’re having trouble focusing. Or in these days of working from home, perhaps sharing code over a video link. While you could always change the font size in the editor by using preferences, that’s a lot of trouble if you just need a temporary boost in font size. As of 9.6.0.6 you have the ability to zoom in on a specific open member using the keyboard shortcut Ctrl + (or on a Mac, use command +). (See Figure 2.) Keep pressing the + until you get the font size you want. When you’re ready to make the font smaller again, use Ctrl – (or command – on Mac). Note that the font only changes on the member you’re currently looking at – any other open members stay the same.

    Figure 2: Zoom

    Refactor Constant Text

    Help with refactoring code is always helpful. A couple of years ago, the refactoring menu in the editor appeared with an option for renaming things such as variables. As of 9.6.0.6 a second refactoring item appeared in that menu – Extract constant . . . (Note that if you have 9.6.0.7 or later installed, you’ll also see a third menu entry for Extract Procedure. . . . I’ll be covering that in a later tip.)

    We all know that it’s far better to use named constants instead of literal values in our code, especially if there is (or may be) more than one reference to the value. This new support makes it much easier to implement named constants after the fact in your code. It will not only create the constant definition for you, it will also replace all references to that same constant value in the code. So far, this option only works for text constants. I’m hoping we’ll see a similar feature for numeric constants at some point in the future.

    If you’re familiar with the rename refactoring option, the extract constant option will feel very familiar. For those who may not have used rename, here’s how the process works.

    First, select some constant text in your code (i.e., some text in quotes). You don’t need to select the entire constant value – selecting any part of it is fine. Next, right click and choose Refactor > Extract constant… and you will get the Extract Constant dialog box. A suggested name for your named constant will be filled in, but you can modify that to whatever you want. These steps are illustrated in Figure 3.

    Figure 3: Extract Constant

    If you want to preview the refactoring changes that will be made, you can do that either by ticking the
    “Force preview” box or hitting the Preview button. Alternatively you can hit “OK” and all the changes will be made automatically in your editor view. Of course, you can always undo those changes if you decide after the fact that it wasn’t exactly what you wanted. A picture of the preview dialog appears in Figure 4.

    Figure 4: Extract Constant Preview

    Do You Compile in Batch?

    Personally, I don’t like to do my RDi compiles in batch. I have set my preference to compile in my RDi connection’s job. If you want to give that option a try, go to Preferences > Remote Systems > IBM i > Command Execution and de-select the “Compile in batch” box.

    However, I’m sure there are many of you out there who prefer the default behavior of submitting compiles to batch. Prior to 9.6.0.6, the job name for those submitted compiles was different from the name that a PDM batch compile used. Now it will use the name of the source member — exactly the same behavior that PDM has. So now your batch compile jobs will be consistently named if you switch back and forth between compiling in PDM and RDi.

    There are many more enhancements that have been added to RDi 9.6. These include some nice enhancements to existing features as well as refactoring support for creating subprocedures from existing logic that I mentioned earlier. There is also a new view that makes modifying your library list easier. I’ll explore those and other new RDi enhancements in later tips

    RELATED STORIES

    Guru: RDi V9.6, Part 6 – The New Object Table Gets Even Better

    Guru: Ready Or Not! Part 5 Of Big Changes In RDi V9.6, Edit/Browse Toggle, PDM Perspective, More

    Guru: Ready or Not! Part 4 of Big Changes in RDi V9.6, PDM Affinity with Object Table

    Guru: Ready or Not! Part 3 of Big Changes in RDi V9.6, Compare/Merge, Code Coverage, and More

    Guru: Ready or Not! Part 2 of Big Changes in RDi V9.6, Hover and Annotations

    Guru: Ready Or Not, Big Changes in RDi V9.6! Part 1, Key Behavior

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: 400guru, FHG, Four Hundred Guru, IBM i, PDM, RDi, RPG

    Sponsored by
    Chilli IT

    Chilli is one of the UKs leading IBM support and management providers with 20 years’ experience in the power and storage industry. Our bespoke solutions for maintenance, security and infrastructure delivers a service which is cost effective, increases productivity and enhances efficiency. Our ethical approach and unrivalled knowledge has secured business partnerships with blue-chip companies in the technology, retail, banking and travel sectors.

    As an IBM Business Partner, we provide you with the peace of mind that you are working in partnership with a company accredited to the highest standard. Our team of experts have worked together for many years and deliver projects which include consolidation, High Availability, Operating System upgrades; and backup and recovery installations.

    Contact us to see how we can help your business with IBM support and management.

    www.chilli-it.co.uk

    info@chilli–it.co.uk

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    As I See It: COBOL In The Time Of COVID Thoroughly Modern: Digital Modernization, But Not At Any Cost

    Leave a Reply Cancel reply

TFH Volume: 30 Issue: 30

This Issue Sponsored By

  • TL Ashford
  • Fresche Solutions
  • ARCAD Software
  • Fresche Solutions
  • Raz-Lee Security

Table of Contents

  • Powers Of Ten
  • Thoroughly Modern: Digital Modernization, But Not At Any Cost
  • Guru: RDi V9.6 Part 7 – Zoom in, Know Where You Are, Refactor Constants and More
  • As I See It: COBOL In The Time Of COVID
  • What’s New With Db2 Web Query?

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM i 7.3 TR12: The Non-TR Tech Refresh
  • IBM i Integration Elevates Operational Query and Analytics
  • Simplified IBM i Stack Bundling Ahead Of Subscription Pricing
  • More Price Hikes From IBM, Now For High End Storage
  • Big Blue Readies Power10 And IBM i 7.5 Training for Partners
  • IBM Delivers More Out-of-the-Box Security with IBM i 7.5
  • Groundhog Day For Malware
  • IBM i Community Reacts to IBM i 7.5
  • Four Hundred Monitor, May 11
  • IBM i PTF Guide, Volume 24, Number 19

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.