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 >
Wrap
Text File
|
1998-02-24
|
692b
|
15 lines
/* This macro inserts the name of the current file, with */
/* path information in the current line at the cursor */
'EXTRACT CURSORPOS'
'EXTRACT NAME'
'EXTRACT CONTENT'
namenum = length(name) /* determine length of filename & path */
beginning=cursorpos-1
start = substr(content,1,beginning) /* determine text prior to cursor if any */
lastpart = length(start)+1
ending = substr(content, lastpart) /* determine text after cursor if any */
'SET CONTENT' start||name||ending /* reset the line with the filename & path */
newposition=lastpart+namenum
'SET CURSORPOS' newposition /* move cursor following filename */