COBOL comes first (this time)

September 27, 2007

I was just writing some COBOL source code (which is a challenge since I don’t really know COBOL) to test some of the new features we are working on when I cam across a cool editor feature for COBOL that I didn’t know we even had for COBOL. And it doesn’t exist yet for RPG!

Normally when we add new features to the RSE we put them in for RPG first and then COBOL either at the same time or later on. Simply because RPG is more widely used on System i than COBOL.

Back to my story. Like any good programmer I was trying to add comments to my source. Not knowing how COBOL expects comments to appear, I first tried // comment. Nope, synatx error. Next I tried /* */ which worked, but at the same time I accidently hit some key combination that put a * in column 7. Updated: apparently /* */ doesn’t work.

Whoa, backup. We have an auto comment / uncomment action for COBOL? Apparently so. Just like the Java editor, if you press Ctrl + / it automatically comments out the current line (or selection of lines). And Ctrl + \ automatically uncomments the line.

I’m going to assume that kudos goes to Adrian for that one. Now, if we only had that for RPG like everyone asks for :)

5 Responses to “COBOL comes first (this time)”


  1. That feature would be a nice time saver if added to RPG. Add my vote for getting it in the next version!!

    Do you guys “extend” a base LPEX editor object for the different parsers? It would seem this would be a great one to have in the “base object” and then all languages could easily use it. I guess where it could get messy is with the different syntax implementations and knowing where to place the slashes so the compiler accepted them.

    [typing this with my Blackberry tethered to my laptop on my way to the SystemiDeveloper.com conference:-) ]

    Aaron Bartell
    http://mowyourlawn.com

  2. Don Yantzi Says:

    There is one LPEX editor that then chooses which parser to use based on the parser associations. Following proper OO design, we do have a base class that all parsers extend from. As you guessed, something like this is very language specific (detecting if the line is already commented, where does the comment go, is it free-form RPG or fixed, …) so not much can be shared except for the shortcut key. Which is the easy part :)

    Don.

  3. Don Yantzi Says:

    And have fun at the SystemiDeveloper conference.

  4. Nazmin Haji Says:

    Hey Don,
    Long weekend is here (Thanksgiving for Canadians – yes it comes early here, in case you are wondering). You should have some time to put this feature in RPG. Go for it. Good way to learn all about comments in RPG:)

  5. Idetrorce Says:

    very interesting, but I don’t agree with you
    Idetrorce


Leave a Reply

You must be logged in to post a comment.