home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
epmsmp.zip
/
GLOBFIND.E
< prev
next >
Wrap
Text File
|
1992-08-26
|
2KB
|
49 lines
/* Ctrl-G = Global-find key. Standard E3 lets you press Ctrl-F to */
/* repeat-find in the current file. Now Ctrl-G does the repeat-find */
/* on ALL the files in the ring. Very useful when I'm editing several*/
/* small program modules and I want to find where something's defined.*/
/* */
/* Installation: Include this in your MYKEYS.E. There's nothing */
/* special about the choice of key Ctrl-G, change the DEF if you like.*/
DEF c_g=
/* Remember our current file so we don't search forever. */
getfileid StartFileID
/* First repeat-find in current file in case we don't have to move.*/
repeat_find
if rc=0 then stop endif
fileid=StartFileID
loop
nextfile
getfileid fileid
activatefile fileid
/* Include this refresh if you like to see each file as it's */
/* searched. Causes too much screen flashing for my taste, */
;; refresh
/* Start from top of file, save current posn in case no match. */
call psave_pos(save_pos)
top ; .col=1
repeat_find
if rc=0 then
if fileid=StartFileID then
sayerror "String not found anywhere else"
else
sayerror 0
endif
leave
else
/* no match in file - restore file location */
call prestore_pos(save_pos)
endif
if fileid=StartFileID then
sayerror "String not found anywhere at all!"
leave
endif
endloop
activatefile fileid