@if "%TEMPVERS%." == "." goto ERR1
@if "%TEMPVCV%." == "." goto ERR2
@if NOT EXIST chglist%TEMPVERS%.txt goto NOCHANGELIST
@set TEMPERR=no
@set TEMPCCNT=0
@for /F "tokens=*" %%i in (chglist%TEMPVERS%.txt) do @(call :CHKITEM %%i)
@if "%TEMPERR%x" == "yesx" goto ERR3
@echo Zipping %TEMPCCNT% files to %TEMPVCV%chg%TEMPVERS%.zip, from chglist%TEMPVERS%.txt...
@call zip8 -a -o -P %TEMPVCV%chg%TEMPVERS%.zip @chglist%TEMPVERS%.txt
@if NOT EXIST %TEMPVCV%chg%TEMPVERS%.zip goto ERR4
@goto END

:CHKITEM
@if "%1x" == "x" goto :EOF
@if NOT EXIST %1 goto :NOITEM
@set /A TEMPCCNT+=1
@goto :EOF

:NOITEM
@echo ERROR: Item in chglist%TEMPVERS%.txt file, namely [%1] NOT FOUND!
@echo ERROR: CHECK THIS FILE!
@set TEMPERR=yes
@pause
@goto :EOF

:ERR1
@echo ERROR: Version (TEMPVERS) NOT SET ...
@goto WAIT

:ERR2
@echo ERROR: VC Version (TEMPVCV) NOT SET ...
@goto WAIT

:ERR3
@echo ERROR: Have missing file in chglist%TEMPVERS%.txt...
@echo ERROR: Exit and fix first...
@goto WAIT

:ERR4
@echo ERROR: Zip file %TEMPVCV%chg%TEMPVERS%.zip NOT CREATED!
@echo ERROR: Big problem! Exit and fix first...
@goto WAIT

:NOCHANGELIST
@echo chglist%TEMPVERS%.txt DOES NOT EXIST ... This could be an error,
@echo or simply that there are NO changes to apply ...
@echo WHICH WOULD BE GREAT, but unusual!!!
@goto WAIT

:WAIT
@pause
@goto END

:END
