@ECHO OFF
ECHO [1;36;40m
CLS
GOTO START
REM  ***************** \QUAL2EU\Q2PLOTS\Q2PLOT.BAT ***************
REM  *       Author: D.W. Disney, Senior Scientific/Engineering  *
REM  *                            Computer Specialist            *
REM  *               DynTel Corporation                          *
REM  *         Date: Tuesday, 7 May 1996.  Time: 10:56:35.       *
REM  *  Environment: Microway 486 B2T/50, DOS 6.00               *
REM  * Installation: DynTel Corporation                          *
REM  *               U.S. Environmental Protection Agency        *
REM  *               NERL - Ecosystems Research Div., Athens, GA *
REM  *     Function: Execute Q2PLOT program.                     *
REM  *     Calling                                               *
REM  *     Sequence: Q2PLOT                                      *
REM  *        Input: Command line: None                          *
REM  *               Other: Q2PLOT run time prompts              *
REM  *************************************************************
REM  ----- Label START ------------------------------------------------------
:START
IF "%1"=="DEBUG" GOTO CHECKEXE
IF "%1"=="debug" GOTO CHECKEXE
IF EXIST C:\00\QUAL2EU\XQ2PLOTX.EXE GOTO RUN_Q2P1
GOTO ERROR1
REM  ----- Label CHECKEXE ---------------------------------------------------
:CHECKEXE
IF EXIST \QUAL2EU\Q2PLOTS\XQ2PLOTX.EXE GOTO RUN_Q2P1
REM  ----- Label ERROR1 -----------------------------------------------------
:ERROR1
ECHO #
ECHO # ----------------------------------------------------------------------
ECHO #
ECHO ##  ERROR:  BAD OR MISSING XQ2PLOTX.EXE FILE
ECHO #
ECHO #           The Q2PLOT executable task image file XQ2PLOTX.EXE is
ECHO #           not located in DOS sub-directory C:\00\QUAL2EU.
ECHO #
ECHO #           Install and/or copy this file and all of its support
ECHO #           files to sub-directory C:\00\QUAL2EU or
ECHO #           contact CEAM for assistance.
ECHO #
ECHO #   Press "<Enter>" key to return to DOS command prompt.
PAUSE >NUL
GOTO STOP
REM  ----- Label RUN_Q2P1 ---------------------------------------------------
:RUN_Q2P1
IF "%1"=="DEBUG" GOTO CHECKWDM
IF "%1"=="debug" GOTO CHECKWDM
IF EXIST C:\00\QUAL2EU\MESSAGE.WDM GOTO RUN_Q2P2
GOTO ERROR2
REM  ----- Label CHECKWDM ---------------------------------------------------
:CHECKWDM
IF EXIST \QUAL2EU\Q2PLOTS\MESSAGE.WDM GOTO RUN_Q2P2
REM  ----- Label ERROR2 -----------------------------------------------------
:ERROR2
ECHO #
ECHO # ----------------------------------------------------------------------
ECHO #
ECHO ##  ERROR:  BAD OR MISSING MESSAGE.WDM FILE
ECHO #
ECHO #           The Q2PLOT screen definition file MESSAGE.WDM is
ECHO #           not located in DOS sub-directory C:\00\QUAL2EU.
ECHO #
ECHO #           Install and/or copy this file to sub-directory
ECHO #           C:\00\QUAL2EU or contact CEAM for assistance.
ECHO #
ECHO #   Press "<Enter>" key to return to DOS command prompt.
PAUSE >NUL
GOTO STOP
REM  ----- Label RUN_Q2P2 ---------------------------------------------------
:RUN_Q2P2
CLS
ECHO #
ECHO #----------------------------------------------------------------------#
ECHO ##  Executing Q2PLOT DOS command file.
ECHO #----------------------------------------------------------------------#
ECHO #
ECHO #
ECHO ##  Loading Q2PLOT program task image file...wait.
IF EXIST TEST.DAT DEL TEST.DAT >NUL
REM
IF "%1"=="DEBUG" SET LFDIR=D:\F77L3\BIN\
IF "%1"=="debug" SET LFDIR=D:\F77L3\BIN\
IF "%1"=="DEBUG" GOTO RUN__Q2P
IF "%1"=="debug" GOTO RUN__Q2P
SET LFDIR=C:\00\QUAL2EU
REM  ----- Label RUN__AQ2 ---------------------------------------------------
:RUN__Q2P
IF "%1"=="" GOTO TRMDATOK
IF EXIST \QUAL2EU\Q2PLOTS\TERM.DAT GOTO TRMDATOK
IF "%1"=="DEBUG" ECHO #
IF "%1"=="debug" ECHO #
IF "%1"=="DEBUG" ECHO ##  COPYing Q2PLTTRM.DAT file to TERM.DAT...
IF "%1"=="debug" ECHO ##  COPYing Q2PLTTRM.DAT file to TERM.DAT...
IF EXIST \QUAL2EU\Q2PLOTS\Q2PLTTRM.DAT COPY \QUAL2EU\Q2PLOTS\Q2PLTTRM.DAT \QUAL2EU\Q2PLOTS\TERM.DAT /V >NUL
REM  ----- Label TRMDATOK ---------------------------------------------------
:TRMDATOK
IF "%1"=="DEBUG" \QUAL2EU\Q2PLOTS\XQ2PLOTX
IF "%1"=="debug" \QUAL2EU\Q2PLOTS\XQ2PLOTX
IF "%1"=="DEBUG" GOTO ENDRUN
IF "%1"=="debug" GOTO ENDRUN
ECHO #
ECHO #------------------------#
ECHO ##  Q2PLOT run beginning.
ECHO #------------------------#
ECHO #
ECHO #                                    >>Q2P__RUN.LOG
ECHO # ----- RUN DATE/TIME STAMP ----- #  >>Q2P__RUN.LOG
ECHO # ----- Begin Execution     ----- #  >>Q2P__RUN.LOG
ECHO #                                    >>Q2P__RUN.LOG
DATE <C:\00\QUAL2EU\RETURN1.ANS | FIND "C" >>Q2P__RUN.LOG
TIME <C:\00\QUAL2EU\RETURN1.ANS | FIND "C" >>Q2P__RUN.LOG
ECHO #                                    >>Q2P__RUN.LOG
REM CLS
C:\00\QUAL2EU\XQ2PLOTX
ECHO #                                   >>Q2P__RUN.LOG
ECHO # ----- End Execution       ----- # >>Q2P__RUN.LOG
ECHO #                                   >>Q2P__RUN.LOG
DATE <C:\00\QUAL2EU\RETURN1.ANS | FIND "C" >>Q2P__RUN.LOG
TIME <C:\00\QUAL2EU\RETURN1.ANS | FIND "C" >>Q2P__RUN.LOG
ECHO #                                   >>Q2P__RUN.LOG
ECHO # --------------------------------------------------- # >>Q2P__RUN.LOG
REM
REM  ----- Label ENDRUN -----------------------------------------------------   
:ENDRUN
SET LFDIR=
ECHO [1;36;40m
ECHO ##  Q2PLOT program execution complete.
IF "%1"=="DEBUG" ECHO #   Press "<Enter>" key to return to DOS command prompt.
IF "%1"=="debug" ECHO #   Press "<Enter>" key to return to DOS command prompt.
IF "%1"=="DEBUG" PAUSE >NUL
IF "%1"=="debug" PAUSE >NUL
REM  ----- Label STOP -------------------------------------------------------   
:STOP
ECHO.
IF "%1"=="DEBUG" GOTO FINISH
IF "%1"=="debug" GOTO FINISH
CLS
IF NOT EXIST C:\00\QUAL2EU\QUALMENU.TXT ECHO #
IF NOT EXIST C:\00\QUAL2EU\QUALMENU.TXT ECHO #
REM
IF NOT EXIST C:\00\QUAL2EU\QUALMENU.TXT GOTO FINISH
TYPE C:\00\QUAL2EU\QUALMENU.TXT
REM  ----- Label FINISH -----------------------------------------------------   
:FINISH
