home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmrex.zip / COMMENT.ERX < prev    next >
Text File  |  1992-08-28  |  768b  |  21 lines

  1. /*
  2.  * Name        COMMENT.ERX
  3.  *
  4.  * Author      Ralph E. Yozzo
  5.  *
  6.  * Function    An example EPM REXX macro.
  7.  *             This macro adds a blank comment to the end of lines
  8.  *             that are less than 50 characters in length.
  9.  */
  10. size=50                           /* the maximum size of the line to modify */
  11. parse arg args
  12. 'top'
  13. 'extract /last'
  14. totallines=last.1                 /* Save the total number of lines in file */
  15. do i = 1 to totallines
  16.    'extract /getline/line'
  17.    /* change lines that are less than 50 characters */
  18.    if length(getline.1)<size then  call etkreplacetext substr(getline.1,1,size)|| '/*'||substr('',1,30)||'*/',line.1
  19.    if line.1 < totallines then '+1' /* Move down one line if we are not at the bottom */
  20. end
  21.