home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
epm603a.zip
/
EPMSMP.ZIP
/
EPAIRS.E
< prev
next >
Wrap
Text File
|
1995-01-09
|
2KB
|
52 lines
; This can be used to edit all pairs of files in a CMPTREE output, or
; you can line-mark the desired subset and just those will be loaded.
; It's intended for use with EPMCOMP (or E3COMP), and so only loads
; pairs of files - any unpaired files will be skipped.
-- EPAIRS.E, by Larry Margolis - MARGOLI at YKTVMV
defc epairs
getfileid treefileid
if .filename <> '.tree' then
sayerror "This is not a tree file. You must be in a tree buffer to invoke EPairs."
return
endif
firstline = 1; lastline = .last -- Could be 3 to (.last-1), but allow for user editing file.
if leftstr(marktype(), 1)='L' then
getmark l1, l2, c1, c2, markfid
if markfid = treefileid then
firstline = l1; lastline = l2
endif
endif
display -1
prevfilename = ''
prevfilenamex = ''
loaded = 0
for linenum = lastline to firstline by -1
getline content, linenum, treefileid
filenamex = substr(content, 52)
if pos(substr(filenamex,2,1), ":\.") then
if substr(content, 46, 1) = 'D' then
iterate
endif
lp = lastpos('\', filenamex)
filename = substr(filenamex, lp+1)
if filename = prevfilename then
'e' filenamex prevfilenamex
activatefile treefileid
loaded = 1
endif
prevfilename = filename
prevfilenamex = filenamex
endif
endfor
display 1
if loaded then nextfile; endif
defmain
"epairs" arg(1)
compile if EVERSION >= 6
EA_comment 'This defines the EPAIRS command, to edit pairs of files from CmpTree output; it can be linked in or executed directly.'
compile endif