View previous topic :: View next topic |
Author |
Message |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Tue Apr 07, 2009 9:29 am Post subject: Comment in PL1 |
|
|
How can I comment out a block of PL1 codes that already have comments in them? REXX alows that. Example:
Code: |
statement 1;
statement 2;
/*
statement 3 /* Comment for 3 */
statement 4 /* Comment for 4 */
.....
.....
statement 10 /* Comment for 10 */
*/
statement 11;
........
........
|
|
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Apr 07, 2009 10:02 am Post subject: |
|
|
I haven't used PL/I in ages, but I seem to recall using preprocessor statements to branch around large blocks of code. If PL/I doesn't support nested comments, then another fairly 'easy' way to do it is to write an edit macro that takes 2 lines by a label or line command command and adds the /* */ around those lines and changes all the /* and */ within those lines to something like /+ +/
Most likely someone has one already. If I find one or find time to throw one together, I'll let you know. Shouldn't be but about 10 lines, maybe twice that if you want it to go both ways (comment or uncomment), and a bit more if you are afraid that there will already be /+ or +/ in the existing code. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Tue Apr 07, 2009 10:32 am Post subject: |
|
|
Semigeezer,
This is exactly what I did, change /* and */ within the commented out block to /+ and +/. Change /+ and +/ back again when I want to uncomment the block. Just want to see if there is a easier way.
BTW, there is no need to write your own macro. use the command 'c /* /+ .a .b all' (where .a .b are the labels on the lines). |
|
Back to top |
|
 |
prino Banned
Joined: 01 Feb 2007 Posts: 45 Topics: 5 Location: Oostende
|
Posted: Wed Apr 15, 2009 12:14 am Post subject: |
|
|
Code: |
%if 'This' = 'commented out' %then
%do;
%end;
|
Simple and self-commenting  |
|
Back to top |
|
 |
|
|