home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
ez-btm11.exe
/
FINDALL.BTM
< prev
next >
Wrap
Text File
|
1994-05-05
|
4KB
|
119 lines
:: FINDALL.BTM
set source=%@search[%0]
:: %@filename[%source] - Looks for specified files, or a string thereof,
:: using Ledbetter's (c) WHEREIS (STT), then searches diskette catalogue
:: created with David Frey's DFC.BTM (c), then calls results to screen
:: via Buerg's (c) LIST (or 4DOS internal command "list").
: Basic routines based on David Frey's DFC.BTM.
: Last edited September 3, 1992; HELP modified March 30, 1994
: By Itamar Even-Zohar
:: --------------------
:: SYNTAX:
:: FINDALL filename, or "string"
:: where "string" means: any string anywhere in the filename or its
:: description.
:: NOTE: "string" MUST be put between inverted commas.
:: NOTE: You can use filenames without extension. If you use
:: wildcards, no efficient search in the catalogue will be executed.
:----Batch begins here--------------------------------
if "%&" == "" goto help
goto check_whereis
:check_whereis
rem Finds out if Ledbetter's program is found on your path.
iff "%@search[whereis.exe]" =="" .and. "%@search[SST.exe]" =="" then
echo.
echo You need Ledbetter's SST (formerly WHEREIS) to run this sub-program
quit
endiff
:get
echo.
echos Searching for: %&
echo.
echo Please wait...
setlocal
call settemp.btm
set findall=%temp%findall.tmp
:set_whereis
rem Sets variable "whereis" to either WHEREIS or SST (whatever is
: found on disk).
iff "%@search[whereis.Exe]" =="" .and. not "%@search[SST.Exe]" =="" then
set whereis=sst
else
set whereis=whereis
endiff
gosub list?
rem Search performed by WHEREIS.EXE (or SST.EXE) on the whole disk,
: including archives.
(echo.^echo Files found on disk
echo ──────────────────────────────────────────────────────────────────────────── ^
%whereis %& -o"&f &m" -a) >%findall
:match1
: This procedure checks if anything at all was found by looking
: at the 4th line. If this line contains '*EOF*', then nothing
: was found.
iff %@index[%@line[%findall,3],*EOF*] ge 0 then
echo ==`>` No match found on disk for "%&" >>%findall
echo.
endiff
(echo.^echo Files found in Catalogue of Diskettes:^echo (Press W to see full text of description)^echo Disk Scanned File Size Date Time Description ^
echo ──────────────────────────────────────────────────────────────────────────── ^
grep -i "%&" %diskdb) >>%findall
:match2
: This procedure checks if anything at all was found by looking
: at the LAST line. If this line contains '──' (part of the longer
: line), then nothing was found in the catalogue.
iff %@index[%@line[%findall,%@lines[%findall]],──] ge 0 then
echo ==`>` No match found in %diskdb for "%&" >>%findall
endiff
:callfile
%list %findall
endlocal
quit
:=== HELP ===
:help
set lnumber=2
:: (modify if necessary)
iff exist %@search[masthelp] then
call masthelp
unset lnumber source
cancel
else
cls^screen 3 4 You must have %@upper[masthelp.btm]
screen %@eval[%_row+1] 4 for this HELP procedure to work
echo.
quit
endiff
:==============SUB-ROUTINES================
:list?
rem Cancels a "list" alias, if it exists.
iff not "%@alias[list]" == "" then
unalias list
endiff
gosub list??
return
:
:list??
rem Checks if Buerg's LIST exists; else sets
rem 4DOS internal command ("list").
iff not "%@search[list.com]" == "" then
set list=%@search[list.com]
else
set list=list
endiff
return