home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / oswait01.zip / README.DOC < prev    next >
Text File  |  1994-04-09  |  6KB  |  182 lines

  1.   DOSWAIT!, OSWAIT!, & OSWAITF!  (c) 1994, John M. Warren & ITECH-CIS
  2.  
  3.     TABLE OF CONTENTS
  4.  
  5.     ..DISCLAIMER & WARRANTY
  6.     ..REGISTRATION
  7.     ..WHAT THE PROGRAM DOES
  8.     ..HOW TO USE THE PROGRAM
  9.     ..PROGRAM SYNTAX
  10.     ..WHAT THE HECK IS AN ERRORLEVEL?
  11.     ..A SPECIAL NOTE ABOUT BATCH FILES & ERRORLEVELS
  12.     ..SOURCE CODE
  13.     ..A PLUG FOR MY PROGRAMMERS BBS
  14.  
  15.  
  16.   DISCLAIMER & WARRANTY
  17.  
  18.   The author claims no responsibility for the use of this product.
  19.  
  20.   The source code to this program is provided for educational purposes
  21.   only and may not be duplicated, nor compiled for distribution without
  22.   the written consent of the author, John M. Warren.  However, the
  23.   program itself may freely distributed as shareware, so long as no
  24.   modifications are made to it's content.
  25.  
  26.   REGISTRATION
  27.  
  28.   I would like to finish college some day.  Send me $5 and I'll send
  29.   you a registered copy of all three programs along with a list other
  30.   applications and utilities that are available.  Send your check,
  31.   or money order to :
  32.  
  33.          John M. Warren
  34.          P.O. Box 609
  35.          Vernon, FL. 32462
  36.  
  37.   Non-U.S. orders please send $10
  38.  
  39.  
  40.   WHAT THE PROGRAM DOES
  41.  
  42.   DOSWAIT!, OSWAIT!, & OSWAITF! are utilities for the DOS and OS/2
  43.   operating systems.  Simply put, each program will delay your
  44.   computer a specified amount of seconds, then continue when the
  45.   timer gets down to 0. However, if the user presses the "Q" key
  46.   the program will terminate with an errorlevel of 1.  Don't worry
  47.   if you don't know anything about errorlevels, your about to learn.
  48.  
  49.  
  50.   HOW TO USE THE PROGRAM
  51.  
  52.   1. If you know what the heck your doing already, and feel this
  53.      documentation is a waste of time for you, check out the 2
  54.      files SAMPLE.BAT, and if you use OS/2 SAMPLE.CMD
  55.  
  56.   2. If you don't know what errorlevels are, read the "ERRORLEVEL
  57.      TUTORIAL" section first. It will give you a tutor on errorlevel
  58.      andbatch files.
  59.  
  60.  
  61.    PROGRAM SYNTAX
  62.  
  63.    ---------------------------------------------------------------
  64.    DOSWAIT!  [seconds]
  65.  
  66.    Example :    C:\> DOSWAIT!.EXE 30
  67.  
  68.    This exmaple will cause a system delay of 30 seconds.
  69.  
  70.    ---------------------------------------------------------------
  71.  
  72.    OSWAIT! & OSWAITF!
  73.  
  74.    1. OSWAIT! is used for OS/2 sessions which are in a window.
  75.    2. OSWAITF! is used for OS/2 sessions which are full screen.
  76.  
  77.    Example :   C:\> OSWAIT! 30
  78.  
  79.    This example will cause a system delay of 30 seconds.  If it is
  80.    executed from the OS/2 prompt then an OS/2 windowed session will
  81.    be created.
  82.  
  83.    Example :   C:\> OSWAITF! 30
  84.  
  85.    This example will cause a system delay of 30 seconds.  If it is
  86.    executed from the OS/2 prompt then an OS/2 full screen session will
  87.    be created.
  88.  
  89. *********************** AN ERRORLEVEL TUTORIAL **********************
  90.  
  91.   WHAT THE HECK IS AN ERRORLEVEL?
  92.  
  93.   An errorlevel is a numeric value passed to DOS whenever a computer
  94.   application terminates.  If a computer program returns an
  95.   errorlevel of 0 this means that the program terminated normally
  96.   without any errors or any hitches.  If a computer program returns
  97.   an errorlevel other than 0 then that usually means an error occured
  98.   within the program.  Errorlevel values vary from program to program.
  99.   In other words if your running a word processing program and say it
  100.   can't read a bad diskette it may terminate with an errorlevel of 3
  101.   the computer programmers designed the word processor to return this
  102.   value whenever this error is encountered.  In a spreadsheet if the
  103.   diskette can't be read, it may return an errorlevel of 5.  So,
  104.   errorlevel values are specific to whatever application you are running.
  105.   If you look hard in most manuals, you can usually find possible
  106.   errorlevel values and a description of each for whatever application
  107.   you are using.
  108.  
  109.   USING DOSWAIT!, OSWAIT! and OSWAITF! & ERRORLEVELS
  110.  
  111.   Look at the following.. (line numbers are for reference only)
  112.  
  113.   1 @ECHO OFF
  114.   2 DOSWAIT! 20
  115.   3 IF NOT ERRORLEVEL 1 GOTO DONE
  116.  
  117.   4 Echo User pressed "Q" to terminate.
  118.  
  119.   5 :DONE
  120.  
  121.   Line 2 starts the DOSWAIT! program and tells it to delay for 20
  122.   seconds before continuing.  If the time runs out, then the program
  123.   will terminate with an errorlevel of 0, meaning a normal termination.
  124.   However, if you press "Q" before the time runs out then the
  125.   DOS errorlevel will be set to 1, meaning an abnormal event occured.
  126.  
  127.   Line 3 simply checks the errorlevel value.  If the ERRORLEVEL value
  128.   was not set to 1 then the batch file jumps to DONE and terminates the
  129.   program normally.  However, if the ERRORLEVEL value WAS set to 1 then
  130.   then line 4 is executed.
  131.  
  132.   A SPECIAL NOTE ABOUT BATCH FILES & ERRORLEVELS
  133.  
  134.   One rule of thumb that I would like to mention however.  If you are
  135.   using a program which returns multiple ERRORLEVELS you have to check
  136.   then from highest to lowest value (descending order) like so :
  137.  
  138.         ECHO OFF
  139.  
  140.         MYAPP.EXE
  141.  
  142.         IF ERRORLEVEL 200 GOTO BOB
  143.         IF ERRORLEVEL 199 GOTO DICK
  144.         IF ERRORLEVEL  35 GOTO JANE
  145.         IF ERRORLEVEL  14 .........
  146.  
  147.         ECHO ERRORLEVEL value did not match or was 0
  148.  
  149.         :BOB
  150.          ECHO BOB
  151.          GOTO DONE
  152.  
  153.         :DICK
  154.          ECHO DICK
  155.          GOTO DONE
  156.  
  157.         :JANE
  158.          ECHO JANE
  159.  
  160.         :DONE
  161.  
  162.  
  163. SOURCE CODE
  164.  
  165.   The 'C' source code for this program is contained within the SOURCE.ZIP
  166.   file.  It was written using Bx++ for OS/2 and Tx++ 3.x for DOS.  It took
  167.   about 3 hours to write, test, and document this program.
  168.  
  169.  
  170. A PLUG FOR MY PROGRAMMERS BBS
  171.  
  172.   Code 3, The Game Programmers Connection
  173.   904-535-1705 14.4 Renegade BBS
  174.  
  175.   Graphics Utilities & Engines For C/PAS/BASIC/QBASIC
  176.   Example Game Code
  177.   Lots of other programming goodies as well as 1.2G of shareware.
  178.  
  179.   First time no hassle access, no UL/DL limits, ratios. FREE.
  180.  
  181.   The only restriction is 60 minutes PER CALL. <g>
  182.