925 pts.
 How to strip comments from CL program?
Anyone know of a utility that will strip comments out of a CL program? We have many programs with more comments than actual code (for history purposes) and I'd like to see just the actual code. And no, I don't want to RTVCLSRC and lose indentation, etc.

Software/Hardware used:
ASKED: January 5, 2009  8:06 PM
UPDATED: December 14, 2011  6:07 PM

Answer Wiki:
Hi, In RPG you have specific places where comments can exist or specific lines of code which are comments, however in CL the comments can be on separate lines or before or after your CL commands. It shouldn't be so difficult to write something to do this - maybe there's already a tool available on the net. One thing to bear in mind is that comments are normally placed to help future maintenance of programs - however bad or incorrect comments are more misleading than no comments. Regards, Martin Gilbert.
Last Wiki Answer Submitted:  January 6, 2009  2:05 pm  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

It would be a pretty simple rpg program
OverRide to the member name
Read each line

1. Scan for /* if found
replace every space from there to */ with blanks
repeat 1 until not found
2. if line is blank delete it.
else update it.

Phil

 44,200 pts.

 

Don’t forget that comments, notoriously those attached to a command, can be continued on to multiple lines.

 5,670 pts.