"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "vil96w32/search.rc" of archive vile-w32.zip:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 ; $Header: /usr/build/vile/vile/macros/RCS/search.rc,v 1.3 2001/08/26 19:20:15 tom Exp $
    2 store-procedure SearchForFile
    3 	~local %path %word %test %find %n
    4 	setv %find &trim $pathname
    5 	~if &equal 0 &length %find
    6 		write-message "No filename at the current position"
    7 		~return
    8 	~endif
    9 	~if &seq $majormode ''
   10 		setv %path '.'
   11 	~elseif &seq $majormode 'make'
   12 		setv %path '.:/usr/share/mk'
   13 	~elseif &seq $majormode 'c'
   14 		setv %path '.:/usr/local/include:/usr/include'
   15 	~else
   16 		setv %path &env 'VILE_SEARCH_PATH'
   17 		~if &seq %path ''
   18 			setv %path &env 'CDPATH'
   19 			~if &seq %path ''
   20 				setv %path '.'
   21 			~endif
   22 		~endif
   23 	~endif
   24 	setv %n 0
   25 	~while &not 0
   26 		setv %test ''
   27 		setv %word &token %n $pathlist-separator %path
   28 		~if &seq %word ''
   29 			~break
   30 		~endif
   31 		setv %test &cat %word &cat '/' %find
   32 		~if &rd %test
   33 			~break
   34 		~endif
   35 		setv %n &add %n 1
   36 	~endwhile
   37 	~if &seq %test ''
   38 		setv %test=%find
   39 	~else
   40 		edit-file %test
   41 	~endif
   42 	~if &rd %test
   43 		edit-file %test
   44 	~else
   45 		write-message &cat 'File not found: ' %test
   46 	~endif
   47 ~endm
   48 bind-key SearchForFile ^X-e