home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / editor / epmtools / epmrex / comment.erx < prev    next >
Encoding:
Text File  |  1994-01-31  |  768 b   |  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.