MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Comment in PL1

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Apr 07, 2009 9:29 am    Post subject: Comment in PL1 Reply with quote

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
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Apr 07, 2009 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Apr 07, 2009 10:32 am    Post subject: Reply with quote

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
View user's profile Send private message
prino
Banned


Joined: 01 Feb 2007
Posts: 45
Topics: 5
Location: Oostende

PostPosted: Wed Apr 15, 2009 12:14 am    Post subject: Reply with quote

Code:

 %if 'This' = 'commented out' %then
   %do;


   %end;


Simple and self-commenting Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group