@ECHO OFF
CLS
GOTO START
REM  ******************** \EXAMS\EXAMS.BAT ***********************
REM  *       Author: D.W. Disney, Senior Scientific/Engineering  *
REM  *                            Computer Specialist            *
REM  *               DynTel Corporation                          *
REM  *         Date: Monday, 12 February 1996.  Time: 15:41:08.  *
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 EXAMS program from DOS command line.*
REM  *     Calling                                               *
REM  *     Sequence: EXAMS                                       *
REM  *        Input: Command line: None                          *
REM  *               Other: None                                 *
REM  *************************************************************
REM  ----- Label START ------------------------------------------------------
:START
REM  ----- Label BEGIN ------------------------------------------------------
:BEGIN
IF "%1"=="DEBUG" GOTO CHECKEXE
IF "%1"=="debug" GOTO CHECKEXE
IF EXIST E:\EXAMS\XEXAMSX.EXE GOTO CHECKDA1
GOTO ERR_EXE1
REM  ----- Label CHECKEXE ---------------------------------------------------
:CHECKEXE
IF EXIST \EXAMS\XEXAMSX.EXE GOTO CHECKDA2
GOTO ERR_EXE1
REM  ----- Label CHECKDA1 ---------------------------------------------------
:CHECKDA1
IF NOT EXIST E:\EXAMS\EXAMS.DAF  GOTO ERRORDAF
GOTO EXECUTE
REM  ----- Label CHECKDA2 ---------------------------------------------------
:CHECKDA2
IF NOT EXIST EXAMS.DAF GOTO ERRORDAF
GOTO EXECUTE
REM  ----- Label ERRORDAF ---------------------------------------------------
:ERRORDAF
ECHO #
ECHO #
ECHO ##  WARNING:  EXAMS DATA AND HELP FILE EXAMS.DAF NOT FOUND
ECHO #
ECHO #             An EXAMS unformatted, direct access data and help file
ECHO #             EXAMS.DAF is not in sub-directory E:\EXAMS
ECHO #
ECHO #             Execute NEWDAF command file program to create EXAMS.DAF
ECHO #             file before executing EXAMS.
ECHO #
ECHO #   Press "<Enter>" key to return to DOS command prompt.
PAUSE >NUL
GOTO END
REM  ----- Label EXECUTE ----------------------------------------------------
:EXECUTE
IF "%1"=="DEBUG" TYPE \EXAMS\EXAMOPEN.SCR
IF "%1"=="debug" TYPE \EXAMS\EXAMOPEN.SCR
IF "%1"=="DEBUG" PAUSE >NUL
IF "%1"=="debug" PAUSE >NUL
IF "%1"=="DEBUG" GOTO TYPESCR
IF "%1"=="debug" GOTO TYPESCR
TYPE E:\EXAMS\EXAMOPEN.SCR
PAUSE >NUL
REM  ----- Label TYPESCR ----------------------------------------------------
:TYPESCR
CLS
ECHO #
ECHO #----------------------------------------------------------------------#
ECHO ##  Executing EXAMS program.
ECHO #----------------------------------------------------------------------#
ECHO #
ECHO #
ECHO ##  Loading EXAMS program task image file...wait.
REM
IF "%1"=="DEBUG" SET LFDIR=D:\F77L3\BIN
IF "%1"=="debug" SET LFDIR=D:\F77L3\BIN
IF "%1"=="DEBUG" GOTO RUN_EXAM
IF "%1"=="debug" GOTO RUN_EXAM
SET LFDIR=E:\EXAMS
REM  ----- Label RUN_EXAM ---------------------------------------------------
:RUN_EXAM
IF "%1"=="DEBUG" \EXAMS\XEXAMSX
IF "%1"=="debug" \EXAMS\XEXAMSX
IF "%1"=="DEBUG" GOTO ENDRUN
IF "%1"=="debug" GOTO ENDRUN
ECHO #
ECHO #                                   >>EXAM_RUN.LOG
ECHO # ----- RUN DATE/TIME STAMP ----- # >>EXAM_RUN.LOG
ECHO # ----- Begin Execution     ----- # >>EXAM_RUN.LOG
ECHO #                                   >>EXAM_RUN.LOG
DATE <E:\EXAMS\RETURN1.ANS | FIND "C" >>EXAM_RUN.LOG
TIME <E:\EXAMS\RETURN1.ANS | FIND "C" >>EXAM_RUN.LOG
ECHO #                                   >>EXAM_RUN.LOG
E:\EXAMS\XEXAMSX
ECHO #                                   >>EXAM_RUN.LOG
ECHO # ----- End Execution       ----- # >>EXAM_RUN.LOG
ECHO #                                   >>EXAM_RUN.LOG
DATE <E:\EXAMS\RETURN1.ANS | FIND "C" >>EXAM_RUN.LOG
TIME <E:\EXAMS\RETURN1.ANS | FIND "C" >>EXAM_RUN.LOG
ECHO #                                   >>EXAM_RUN.LOG
ECHO # --------------------------------------------------- # >>EXAM_RUN.LOG
REM  ----- Label ENDRUN -----------------------------------------------------
:ENDRUN
REM ECHO #
REM ECHO ##  EXAMS program complete.
REM ECHO #
REM ECHO #   Press "<Enter>" key to return to DOS command prompt.
REM PAUSE >NUL
GOTO END
REM  ----- Label ERR_EXE1 ---------------------------------------------------
:ERR_EXE1
ECHO #
ECHO # ----------------------------------------------------------------------
ECHO #
ECHO ##  ERROR:  BAD OR MISSING XEXAMSX.EXE FILE
ECHO #
ECHO #           The EXAMS executable task image file XEXAMSX.EXE is not
ECHO #           located in the DOS sub-directory E:\EXAMS.
ECHO #
ECHO #           Install and/or copy this file and all of its support files
ECHO #           to sub-directory E:\EXAMS or call CEAM for
ECHO #           assistance.  Refer to file READ.ME for phone number.
ECHO #
ECHO #   Press "<Enter>" key to return to DOS command prompt.
PAUSE >NUL
REM  ----- Label END --------------------------------------------------------
:END
SET LFDIR=
ECHO.
ECHO.
:STOP
