• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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 © 2025 IT Jungle