home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / macros / getname.lx < prev    next >
Encoding:
Text File  |  1996-02-22  |  692 b   |  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.