Category : Miscellaneous Language Source Code
Archive   : 4LOGIC10.ZIP
Filename : 4LVCPACK.BTM

 
Output of file : 4LVCPACK.BTM contained in archive : 4LOGIC10.ZIP
:*******************************************************************************
: A 4LOGIC batch utility A Free program. All of the code here is released
: to the public domain.
: Name: 4LVCPACK.btm v.1.0
:
: Author: Brad Owen
:
: Description: 4LVC module to pack archives.
:
: ** This program cannot be run standalone **
: ** It can only be called by 4LVC **
:
:*******************************************************************************
@echo off
cls
iff %_batch == 1 then
beep 400 2 350 2 400 2 350 2 400 2 350 2
echo.
echo 4LVCPACK error: This program cannot be run standalone.
quit
endiff

@md %_cwd\4Lvc-wrk >&! NUL
pushd
@cd %_cwd\4Lvc-wrk
echo %@upper[%@name[%1].%@ext[%1]]: >>&! ..\4LVCPACK.0
@del /qy *.* >&! NUL
popd

:*******************************************************************************
: Routine to check for password protection

iff "%@substr[%@name[%1].%@ext[%1],4,1]" EQ "P" then
cls
drawbox 0 0 10 79 0 whi on cya fill blu
scrput 2 32 gre on blu %@upper[%@name[%1].%@ext[%1]]
scrput 3 25 bri yel on blu is a password protected file.
scrput 4 21 bri yel on blu You must enter the correct password
scrput 5 18 bri yel on blu in order to process files in this archive.
scrput 8 32 bri yel on blu [ ]
screen 8 33
input %%pword
iff "%pword" == "" then
cls
beep 400 2 350 2 400 2 350 2 400 2 350 2
echo You MUST enter a password to add files
echo to this archive.
pause
goto GET_PASS
endiff

pkunzip -t -s%pword 4lvcp%lvcext.zip > passtest.0
set ptest=%@line[passtest.0,%@lines[passtest.0]]

iff "%ptest"== "PKUNZIP: No file(s) found." then
cls
beep 400 2 350 2 400 2 350 2 400 2 350 2
echo The password you entered
echo %pword
echo is incorrect
pause Press a key to return to Main Menu
if exist 4LVC.0 del /q 4LVC.0
if exist 4LVC.1 del /q 4LVC.1
del /q passtest.0
set LVCRESP=
set LVCVER=
set LVCNAM=
set ARCHDESC=
set LVCRC=
set pword=
set ptest=
quit
endiff
del /q passtest.0
endiff

: End of routine to check for password
:*******************************************************************************

cls
@cd %_cwd\4Lvc-wrk

echos Extracting all versions of all files from %@name[%1].%@ext[%1]...
iff "%pword" NE "" then
PKUNZIP -en -s%pword ..\%@name[%1].%@ext[%1] >&! NUL
else
PKUNZIP -en ..\%@name[%1].%@ext[%1] >&! NUL
endiff


set LCCZIP=%?
if %LCCZIP EQ 0 PKZIP -q-vcbne ..\%@name[%1].%@ext[%1] >&! 4LVCPACK.0
iff %? EQ 0 then
iff %LCCZIP EQ 0 then
goto DOIT
endiff
endiff
set LCCZIP=
cd ..
@del /qy 4LVC-wrk\*.* >&! NUL
@rd 4LVC-wrk
echo Could not unZIP all archive files and comments. Make sure there is >>&! ..\4LVCPACK.0
echo enough room on your disk, and that it is not write/password protected. >>&! ..\4LVCPACK.0
echo -------------------------------------------------------------------------------- >>&! ..\4LVCPACK.0
quit
:DOIT
set LCCZIP=
set LCCRCD=8
set LCCEND=%@lines[4LVCPACK.0]
:DESCTOP
if %LCCRCD GT %LCCEND goto DESCEND
if "%@substr[%@line[4LVCPACK.0,%LCCRCD],1,6]" EQ "------" goto DESCIN
:DESCOUT
set LCCRCD=%@eval[%LCCRCD + 1]
goto DESCTOP
:DESCIN
set LCCRCD=%@eval[%LCCRCD + 1]
if "%@substr[%@line[4LVCPACK.0,%LCCRCD],1,6]" EQ "------" goto DESCOUT
set LCCNAM=%@substr[%@line[4LVCPACK.0,%LCCRCD],46,12]
set LCCRCD=%@eval[%LCCRCD + 1]
set LCCCOM=%@substr["%@line[4LVCPACK.0,%LCCRCD] ",10,41]
describe %LCCNAM "%LCCCOM"
set LCCCOM=
set LCCNAM=
goto DESCIN
:DESCEND
set LCCRCD=
@del /q 4LVCPACK.0 >&! NUL
set LCCEXT=
set LCCNAM=
echo.
echo ********************************************************************************
echo Resequencing files...
for %%Z in (*.*) do gosub REDUCE

rem handle version 1000 if any exist
iff exist *.000 then
for %%Y in (*.000) do gosub BUMP1000
set LCCEXT=
set LCCNAM=
for %%Z in (*.*) do gosub REDUCE
if exist *.000 del /q *.000 >&! NUL
if exist *.@@@ ren /q *.@@@ *.000 >&! NUL
endiff
set LCCEXT=
set LCCNAM=
set LCCWRK=
echo ********************************************************************************
iff "%LCCZIP" EQ "" then
echo No Resequencing was performed. Archives already PACKed. >>&! ..\4LVCPACK.0
goto WRAPUP
endiff
echos Rearchiving newly resequenced files...
for %%Z in (*.*) do gosub SAVEIT
iff %? NE 0 then
echo Could not reZIP all archive files and comments. Make sure there is >>&! ..\4LVCPACK.0
echo enough room on your disk. >>&! ..\4LVCPACK.0
else
copy %@name[%1].%@ext[%1] ..\*.* >&! NUL
endiff
:WRAPUP
echo -------------------------------------------------------------------------------- >>&! ..\4LVCPACK.0
cd ..
set LCCZIP=
@del /qy 4Lvc-wrk\*.* >&! NUL
@rd 4Lvc-wrk
quit

:BUMP1000
iff exist %@name[%Y].999 then
ren /q %Y *.@@@ >&! NUL
return
endiff
copy %Y *.999 >&! NUL
return

:REDUCE
set LCCWRK=%@upper[%Z]

if "%@ext[%LCCWRK]" EQ "000" return
if "%@ext[%LCCWRK]" EQ "@@@" return

iff "%@name[%LCCWRK]" NE "%LCCNAM" then
set LCCNAM=%@name[%LCCWRK]
set LCCEXT=001
else
set LCCEXT=%@eval[%LCCEXT + 1]
if %@len[%LCCEXT] EQ 1 set LCCEXT=00%LCCEXT
if %@len[%LCCEXT] EQ 2 set LCCEXT=0%LCCEXT
if %@len[%LCCEXT] EQ 4 set LCCEXT=000
endiff

iff "%@ext[%LCCWRK]" NE "%LCCEXT" then
echo %LCCWRK renamed to %@name[%LCCWRK].%LCCEXT
echo %LCCWRK renamed to %@name[%LCCWRK].%LCCEXT >>&! ..\4LVCPACK.0
ren /q %LCCWRK %@name[%LCCWRK].%LCCEXT
set LCCZIP=X
endiff
return

:SAVEIT
if %? NE 0 return
if "%@upper[%@ext[%Z]]" EQ "ZIP" return
set LCCRCD=0
:FINDDESC
iff "%@line[DESCRIPT.ION,%LCCRCD]" EQ "" then
keystack "No Comments Provided " 13
goto HAVEDESC
endiff
iff %@index["%@upper[%@line[DESCRIPT.ION,%LCCRCD]]",%@upper[%@name[%Z].%@ext[%Z]]] EQ 1 then
keystack "%@substr["%@line[DESCRIPT.ION,%LCCRCD] ",%@eval[%@len[%@name[%Z].%@ext[%Z]]+2],40]" 13
else
set LCCRCD=%@eval[%LCCRCD + 1]
goto FINDDESC
endiff
:HAVEDESC
set LCCRCD=
set LCCZIP=%@substr[%@name[%1],4,%@eval[%@len[%@name[%1]] - 4]]
echo %@upper[%Z]


iff "%pword" NE "" then
@pkzip -uqc -s%pword 4LVC%LCCZIP.ZIP %Z >&! NUL
else
@pkzip -uqc 4LVC%LCCZIP.ZIP %Z >&! NUL
endiff


if %? EQ 0 @del /q %Z >&! NUL
set LCCZIP=
return


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : 4LOGIC10.ZIP
Filename : 4LVCPACK.BTM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/