home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv7.zip / vac22os2 / ibmcobol / macros / getname.lx < prev    next >
Text File  |  1998-02-24  |  692b  |  15 lines

  1. /* This macro inserts the name of the current file, with */
  2. /* path information in the current line at the cursor */
  3. 'EXTRACT CURSORPOS'
  4. 'EXTRACT NAME'
  5. 'EXTRACT CONTENT'
  6. namenum = length(name)  /* determine length of filename & path  */
  7. beginning=cursorpos-1
  8.           start = substr(content,1,beginning)   /* determine text prior to cursor if any */
  9. lastpart = length(start)+1
  10.           ending = substr(content, lastpart)    /* determine text after cursor if any  */
  11. 'SET CONTENT' start||name||ending               /* reset the line with the filename & path */
  12. newposition=lastpart+namenum
  13. 'SET CURSORPOS' newposition                     /* move cursor following filename */
  14.  
  15.