• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Let WDSc Help You Format Your Source Code

    August 8, 2007 Ted Holt

    It’s widely accepted throughout the world of programming that indenting source code to show logical structure makes source code easier to read. Program Indentation and Comprehensibility, a study by Richard Miara, Joyce Musselman, Juan Navarro, and Ben Shneiderman, supports this position. Miara, et al, determined that using a two- to four-space indentation scheme improves comprehension by 20 percent to 30 percent. (That’s for humans, of course. The compiler protested that indentation was of no benefit.) Indenting source code is sometimes a nuisance, but it happens that WebSphere Development Studio client (WDSc) can help you indent source code, and can help you improve readability in other ways.

    The features that help you “pretty up” your source code are buried in the preferences within WDSc. To arrive at the preferences in Version 7, follow the following menu trail:

    • Window
    • Preferences
    • Remote Systems
    • Remote Systems LPEX Editor
    • iSeries Parsers

    The sequence is slightly different in Version 6.

    • Window
    • Preferences
    • Remote Systems
    • iSeries
    • LPEX Editor Parser

    In either case, you will eventually arrive at a list of source types.

    • C/C++
    • CL
    • COBOL
    • DDS
    • ILE RPG
    • RPG/400

    Some of these source types expand even further to allow you to maintain templates. Since we’re not interested in templates for now, you won’t need to expand any of the source types.

    The features that are available to you depend on the source type. Let’s look at some of the options, starting with indentation.

    Automatic Indent: Under CL and ILE RPG, you will find an automatic indent option. If you check this option, the system gives you access to a box in which you can specify from one to 20 blanks of indentation. I like the number three. If you turn on this feature, LPEX indents the cursor when you press Enter after keying a line that defines a block structure (e.g., if, do-while).

    Automatic Uppercasing: This option changes the source code to all capital letters as you key it. However, character literals are not affected.

    Automatic Closure of Control Block: If you select this feature of the ILE RPG parser, LPEX automatically generates the corresponding ENDxx op code when you press the Enter key after keying an op code that defines a block structure. You have a choice of five styles: ENDXX, EndXx, Endxx, endXx, and endxx.

    Here are a few CL-only possibilities.

    Automatic Formatting: This option allows you specify the positions where the label, command, and continued lines should begin. This option was already checked in my implementation of WDSc. One of my co-workers had already encountered this setting and was able to tell me how to disable it before I became frustrated.

    Label Above Command: Checking this option tells the parser to place each label on a line by itself.

    One Parameter per Line: If this option is active, the parser places each parameter of a CL command on a line of its own, like this:

    CRTDUPOBJ  OBJ(SOMETHING) +
                 FROMLIB(SOMELIB) +
                 OBJTYPE(*FILE) +
                 TOLIB(OTHERLIB) +
                 NEWOBJ(OTHERTHING) +
                 DATA(*NO)  
    

    When I took programming classes at the vo-tech, I didn’t care what my code looked like. I just wanted something that worked correctly. When I started programming for real and had to maintain the garbage I had written, I began to care about writing legible code. That’s one reason I have enjoyed editing with WDSc. I hope you find some of these editing features helpful as well.



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Manta Technologies

    The Leader in IBM i Education!
    Need training on anything i?
    Manta is all you need.

    130 courses and competency exams on:
    · IBM i operations
    · System Management and Security
    · IBM i Programming Tools
    · Programming in RPG, COBOL, CL, Java
    · Web Development

    SQL, DB2, QueryProduct features:
    · Runs in every popular browser
    · Available 24/7/365
    · Free Student Reference Guides
    · Free Student Administration
    · Concurrent User License
    · Built-In IBM i Simulator

    You can download our 200-page catalog and take sample sessions at MantaTech.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    DRV Technologies:  Automatically convert and distribute AS/400 reports with SpoolFlex
    Maximum Availability:  The ultimate System i replication for business of all sizes
    COMMON:  Join us at the Annual 2008 conference, March 30 - April 3, in Nashville, Tennessee

    IT Jungle Store Top Book Picks

    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    Cape Clear Tests New ESB Release Power6-Based System i Performance: Your Mileage Will Vary

    Leave a Reply Cancel reply

Volume 7, Number 29 -- August 8, 2007
THIS ISSUE SPONSORED BY:

Help/Systems
ProData Computer Services
Guild Companies

Table of Contents

  • Let WDSc Help You Format Your Source Code
  • Which One Is the Culprit?
  • Admin Alert: Eliminating Easy-to-Guess User Passwords

Content archive

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

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

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