home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
ez-btm11.exe
/
EDLIST.BTM
< prev
next >
Wrap
Text File
|
1994-04-30
|
4KB
|
154 lines
:: EDLIST.BTM
set source=%@search[%0]
:: %@filename[%source] handles lists of filenames created with various
:: applications / batch files (such as LED.BTM)
:: Itamar Even-Zohar, March 27, 1994
:: ----------
:: Displays, one by one, all filenames from a list in a specified
:: file, allowing you to
:: (a) select those you wish to leave on the list
:: (b) delete the displayed file from disk
:: (c) view the file before making a decision
:: (d) view the list of selections
:: ----------
:: SYNTAX:
:: %0 filename
setlocal
if .%1==. goto help
set num=0
call settemp
:: (This is a batch which determines which drive will be assigned to
:: "temp".)
set tmpf=%@unique[%temp]
set rsp=%1
cls
if %@eval[%@lines[%rsp]] lt 0 (echo %rsp is empty!^quit)
:edit
iff %@eval[%num] gt %@lines[%rsp] goto application
set fn=%@line[%rsp,%num]
if .%fn==. (set num=%@eval[%num+1]^goto edit)
scrput 0 0 black on white Accept=A/enter Omit=O/Esc D=Delete V=View G=Begin archiving L=View list Q=Quit
echo.
iff %_row lt 2 then
screen 2 0
endiff
echo ==`>` %fn
iff %_row ge %@eval[%_rows -1] then
cls
goto edit^endiff
inkey /K"YNAODVGLQ[ESC][Enter]" A(ccept)? O(mit)? D(elete)? V(iew)? G(o)? (L)ist Q(uit)? %%rep
iff %rep == %@char[27] .or. %rep == O .or. %rep == N then
set num=%@eval[%num +1]
goto edit
:REM: see label ':note' below
elseiff %rep == A .or. %rep == @28 .or. %rep == Y then
echo %fn >>%tmpf
set num=%@eval[%num +1]
goto edit
elseiff %rep == D then
del /q %fn
echo ==`>` %fn deleted^echo.
set num=%@eval[%num +1]
goto edit
elseiff %rep == V then
*list %fn
echo.^goto edit
elseiff %rep == G then
set num=%@eval[%@lines[%rsp]+1]
goto application
elseiff %rep == L then
*list %tmpf
echo.^goto edit
elseiff %rep == Q then set ech=echo Stopped by user^goto end
endiff
:application
cls
echo.
inkey /K"CPQ[ESC][Enter]" Handle file via (C)omfile? (P)kzip, or (Q)uit? %%rep
iff %rep == C then goto comfile
elseiff %rep == P then goto pkzip
elseiff %rep == Q then
set ech=echo %0 terminated by user; %rsp left intact
goto end
endiff
:comfile
input Type desired comfile command: %%cmd
call comf %rsp %cmd
set ech=
goto end
:pkzip
echo.
inkey (P)athnames? (N)ames only? (Q)uit? %%rep
iff %rep == P then
set pkz=pkzip -b%temp -P
elseiff %rep == N then
set pkz=pkzip -b%temp -u
elseiff %rep == Q then goto end
endiff
echo.
echo Type name of ZIP file (or 'enter' for default name)
input --`>` %%rep
iff "%rep"=="" then
set zipfn=%zipfn
else
set zipfn=%rep.zip
endiff
:zip
cls
iff not exist %zipfn then set msg1=Creating
else
set msg1=Updating
endiff
scrput 1 0 bla on whi %msg1 %@upper[%zipfn] Wait ...
screen 3 0
%pkz %zipfn @%rsp
gosub success
goto end
:end
move /q %tmpf %rsp
if %@eval[%@lines[%rsp]] lt 0 (echo No filenames selected from %rsp!^quit)
::*list %rsp
endlocal
quit
--------------------
:help
cls^screen 2 0
set num=2
do forever
set hl=%@instr[3,70,%@line[%source,%num]]
set num=%@eval[%num+1]
if "%hl"=="" leave
::position :: (the following segment is a sidetrack)
iff %@eval[%_row] ge 12 then
screen %@eval[%_row+1] 4 %hl
elseiff %@eval[%_row] ge 7 then
screen %@eval[%_row+1] 7 %hl
elseiff %@eval[%_row] lt 7 then
screen %@eval[%_row+1] 4 %hl
endiff
:: (end_position)
enddo
endlocal
echo.
quit
:: ----end procedure---------------------------------------
:==================SUB-ROUTINES=======================
:success
rem Checking results of archiving (with pkzip)
iff errorlevel eq 12 then
set ech=echo No archive created /updated
else
set ech=echo Archive %@upper[%zipfn] succesfully created /updated
endiff
return