@echo off
   set %@upper[VCNAM=%@name[%1]]
   set %@upper[VCEXT=%@ext[%1]]
   iff not exist 4DVC%VCEXT.ZIP then
      set VCVER=001
      goto CHKVER
   endiff
   @pkzip -vbdr 4DVC%VCEXT.ZIP %VCNAM.* >! 4DVC.0
   @dir /CF %VCNAM.%VCEXT >! 4DVC.1
   if "%@substr[%@line[4DVC.0,9],29,8]" LT "%@substr[%@line[4DVC.1,3],23,8]" goto CALCVER
   if "%@substr[%@line[4DVC.0,9],29,8]" GT "%@substr[%@line[4DVC.1,3],23,8]" goto NOARCH
   set VCTIME=%@substr[%@line[4DVC.1,3],33,5]
   if %@len[%VCTIME] EQ 4 set VCTIME=0%@substr[%VCTIME,0,4]
   iff "%@substr[%@line[4DVC.0,9],39,5]" LT "%VCTIME" then
      set VCTIME=
      goto CALCVER
   endiff
:NOARCH
   echo 
   cls
   set VCTIME=
   drawbox 0  0  6 79 2 yel on bla fill bla
   scrput  2  2 bri yel on bla Bypassing archive request                        4DVC%VCEXT.ZIP contains
   scrput  2 28     yel on bla for file               4DVC%VCEXT.ZIP contains
   scrput  2 37 bri yel on bla %VCNAM.%VCEXT.
   scrput  3  2     yel on bla an entry which is dated equal to or more recently than the DOS date stamp
   scrput  4  2     yel on bla on file               Press a key to continue.
   scrput  4 10 bri yel on bla %VCNAM.%VCEXT.
   screen  5  2
   inkey /W180 %%VCRESP
   goto WRAPUP
:CALCVER
   set VCVER=%@substr[%@line[4DVC.0,9],2,-3]
   set VCVER=%@eval[%VCVER + 1]
   if %@len[%VCVER] EQ 0 set VCVER=001
   if %@len[%VCVER] EQ 1 set VCVER=00%VCVER
   if %@len[%VCVER] EQ 2 set VCVER=0%VCVER
   if %@len[%VCVER] EQ 4 set VCVER=000
:CHKVER
   iff exist %VCNAM.%VCVER then
      echo 
      cls
      drawbox 0  0 16 79 2 bri whi on red fill red
      scrput  2  2 bri whi on red Cannot archive %VCNAM.%VCEXT.
      scrput  2 31     whi on red 4DVC relies upon the availability of filenames
      scrput  3  2     whi on red that end in 000 thru 999 (numeric, inclusive). This is because the file to
      scrput  4  2     whi on red be archived in a .ZIP file (via PKZIP) must already be named exactly
      scrput  5  2     whi on red what you want it to be (you cannot archive              and then rename
      scrput  5 45 bri whi on red %VCNAM.%VCEXT
      scrput  6  2     whi on red it inside the .ZIP file). Therefore, the file must be renamed before
      scrput  7  2     whi on red it is archived, archived under the new name, then renamed back to what
      scrput  8  2     whi on red it was originally called. YOU HAVE A FILE IN THE DEFAULT DIRECTORY CALLED
      scrput  9  2 bri whi on red %VCNAM.%VCVER.
      scrput  9 16     whi on red RATHER THAN ERRONEOUSLY DELETE THAT FILE,
      scrput  9 58 bri whi on red %VCNAM.%VCEXT
      scrput 10  2     whi on red WILL NOT BE ARCHIVED. You may either delete files that end with .000
      scrput 11  2     whi on red thru .999, or copy your other files to be archived to another directory
      scrput 12  2     whi on red and archive them from there.
      scrput 14 27 bri whi on red Press a key to continue.
      screen 14 50
      inkey /W180 %%VCRESP
      goto WRAPUP
   endiff
   cls
   drawbox 0  0  7 79 2 whi on blu fill blu
   scrput  2  9 bri whi on blu About to archive %VCNAM.%VCEXT
   scrput  2 39     whi on blu as              in 4DVC%VCEXT.ZIP.
   scrput  2 42 bri whi on blu %VCNAM.%VCVER
   scrput  3 11     whi on blu Please enter a 40-character comment, or accept the default:
   scrput  5 13 bri whi on blu Comment: [                                          ]
   screen  5 24 `                                        `
   screen  5 24
   keystack "%_date %_time %VCNAM.%VCEXT"
   input %%VCRESP
   @ren /q %1 %VCNAM.%VCVER
   iff "%VCRESP" EQ "" then
      keystack "%_date %_time %VCNAM.%VCEXT" 13
   else
      keystack "%@upper[%VCRESP]" 13
   endiff
   @pkzip -uqc 4DVC%VCEXT.ZIP %VCNAM.%VCVER >! NUL
   @ren /q %VCNAM.%VCVER %1
:WRAPUP
   if exist 4DVC.0 @del /q 4DVC.0 >&! NUL
   if exist 4DVC.1 @del /q 4DVC.1 >&! NUL
   set VCRESP=
   set VCVER=
   set VCEXT=
   set VCNAM=
