Author Topic: Comment/Uncomment Lines and Comment Block in COBOL  (Read 7208 times)

Steve Black

  • Community Member
  • Posts: 57
  • Hero Points: 4
Comment/Uncomment Lines and Comment Block in COBOL
« on: July 27, 2007, 03:14:48 PM »
These functions don't seem to work quite right for COBOL code.  The following examples and comments should illustrate what I mean.

Original code.
Code: [Select]
       01  ::INST::-COLUMN-TABLE.
           05  ::INST::-COLUMN OCCURS 172 TIMES.
               10  ::INST::-COL-VALUE          PIC X(50).
               10  ::INST::-COL-VALUE-1    REDEFINES ::INST::-COL-VALUE.
                   15  ::INST::-COL-VAL-TXT    PIC X(50).

After Comment Lines, the comment character is in column 7 as specified in the extension options, and the commented code is not shifted to the right, which is good.
Code: [Select]
       01  ::INST::-COLUMN-TABLE.
           05  ::INST::-COLUMN OCCURS 172 TIMES.
               10  ::INST::-COL-VALUE          PIC X(50).
      *        10  ::INST::-COL-VALUE-1    REDEFINES ::INST::-COL-VALUE.
      *            15  ::INST::-COL-VAL-TXT    PIC X(50).

After Uncomment Lines, the comment character is removed from column 7, but the commented code has been shifted left one character, which is bad.
Code: [Select]
       01  ::INST::-COLUMN-TABLE.
           05  ::INST::-COLUMN OCCURS 172 TIMES.
               10  ::INST::-COL-VALUE          PIC X(50).
              10  ::INST::-COL-VALUE-1    REDEFINES ::INST::-COL-VALUE.
                  15  ::INST::-COL-VAL-TXT    PIC X(50).            15 

After Comment Block, the code is surrounded as specified by the extension options, but there is no provision for honoring the correct comment column.  Also the code as been shifted right by two characters resulting in truncation at column 72 (according to extension options).  (I do not use right-edge characters in my comment block settings.)
Code: [Select]
       01  ::INST::-COLUMN-TABLE.
           05  ::INST::-COLUMN OCCURS 172 TIMES.
               10  ::INST::-COL-VALUE          PIC X(50).
*********************************************************************
*                10  ::INST::-COL-VALUE-1    REDEFINES ::INST::-COL-
*                    15  ::INST::-COL-VAL-TXT    PIC X(50).
*********************************************************************

The Comment Lines feature needs to be fixed.  I think this was part of the 12.0.2 enhancements, but it just isn't functional within the cobol.e environment.

The Comment Block feature is less important to me, but it would be nice if it worked.  It basically just needs to honor the comment-start column (or have a separate setting), not shift the code, and truncate the right edge box characters if they extend past the truncation position.

Thanks
« Last Edit: July 27, 2007, 03:35:00 PM by Steve Black »

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Comment/Uncomment Lines and Comment Block in COBOL
« Reply #1 on: July 27, 2007, 09:18:07 PM »
Good catch!  I'm afraid I've only got a fix for the first one right now, but give the newest revision of the hotfix a try and see if it makes things better for you when you uncomment lines.

Sorry for the bother.

Cumulative Hotfix:  www.slickedit.com/hotfix -> SlickEdit 2007 (v12x).

Steve Black

  • Community Member
  • Posts: 57
  • Hero Points: 4
Re: Comment/Uncomment Lines and Comment Block in COBOL
« Reply #2 on: July 28, 2007, 06:36:01 PM »
Good job!  Thanks Sandra.