home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / CHOICE.ZIP / CHOICE.DOC < prev    next >
Encoding:
Text File  |  1987-11-25  |  4.5 KB  |  112 lines

  1.                         DOCUMENTATION FOR
  2.  
  3.                              CHOICE
  4.  
  5.      CHOICE Ver. 1.0  Copyright (c) 1984  Bruce N. Wheelock
  6.  
  7. NOTICE: A  limited license is granted to all users of  CHOICE.COM 
  8.         and CHOICE.PAS to make copies of them and distribute them 
  9.         to other users, on the following conditions:
  10.  
  11.         1.   The  program is not to be distributed to  others  in 
  12.         modified form.
  13.         2.   No fee (or other consideration) is to be charged for 
  14.         copying  or  distributing the program without an  express 
  15.         written agreement with the author.
  16.         3.   The  copyright  and description information  in  the 
  17.         program is not to be altered or removed.
  18.  
  19. AUTHOR:       Bruce N. Wheelock
  20.               6333 College Grove Way, Apt. G-4
  21.               San Diego, CA  92115
  22.  
  23.         The  author  may  be contacted on  the  following  public 
  24.         access computer systems:
  25.  
  26.         P.dBMS #1   (619) 444-7099 (address to Bruce N. Wheelock)
  27.         FidoNet/FTL (619) 286-7838 (address to Bruce Wheelock)
  28.  
  29. DESCRIPTION:  CHOICE  is designed to be used within a batch  file 
  30.         under  PC-DOS/MS-DOS ver.  2.0 or later,  to permit  menu 
  31.         selection control;  it will mainly be of interest to hard 
  32.         drive  users.   The  program  is called with  an  integer 
  33.         argument which specifies the largest choice number  which 
  34.         may  be  selected.   CHOICE will prompt the user for  his 
  35.         choice number and check to see whether the number entered 
  36.         is an integer between 0 and the value in the argument. If 
  37.         it is not,  an error message is displayed and the user is 
  38.         again prompted for a choice.  If the number is within the 
  39.         range,  ERRORLEVEL (a batch-testable value) is set to the 
  40.         number  entered,  and the program ends.   ERRORLEVEL  may 
  41.         then  be tested by the batch file and action taken  based 
  42.         on the result.
  43.  
  44. USE:    Here is a sample batch file:
  45.  
  46.         ECHO OFF
  47.         :START
  48.         CLS
  49.         ECHO 1. Run LOTUS 1-2-3
  50.         ECHO 2. Run Microsoft WORD
  51.         ECHO 3. Run Microsoft SPELL
  52.         ECHO 4. Run SMARTCOM II
  53.         ECHO 0. Exit to DOS
  54.         ECHO
  55.         REM The previous line has two (2) blanks after ECHO
  56.         IF NOT ERRORLEVEL 4 GOTO THREE
  57.         SCOM
  58.         GOTO START
  59.         :THREE
  60.         IF NOT ERRORLEVEL 3 GOTO TWO
  61.         SPELL
  62.         GOTO START
  63.         :TWO
  64.         IF NOT ERRORLEVEL 2 GOTO ONE
  65.         WORD
  66.         GOTO START
  67.         :ONE
  68.         IF NOT ERRORLEVEL 1 GOTO ZERO
  69.         LOTUS
  70.         GOTO START
  71.         :ZERO
  72.         IF NOT ERRORLEVEL 0 GOTO START
  73.         REM End of batch file
  74.  
  75. NOTES:  When  ERRORLEVEL  is checked in a batch file,  the IF  is 
  76.         satisfied  if the value is equal to or greater  than  the 
  77.         value tested.  Because of this, testing must begin at the 
  78.         highest  possible  value  and  decrease  to  the  lowest.  
  79.         Detailed  information on batch files may be found in your 
  80.         DOS manual.
  81.  
  82.         Turbo  PASCAL .COM programs have an instruction to  clear 
  83.         the  screen  when  the  program  begins.    This  is  not 
  84.         desirable  in CHOICE.   It is  necessary,  therefore,  to 
  85.         disable   the   screen   clearing   instruction.     This 
  86.         instruction  is  located  at memory  address  02FC.   The 
  87.         instruction is CD10 (Interrupt 10).   It may be  disabled 
  88.         by  changing the instruction to 9090.   To do this  using 
  89.         DEBUG.COM, follow these procedures:
  90.  
  91.              A>DEBUG CHOICE.COM
  92.              -E02FC
  93.              NNNN:02FC CD.90  [Type the 90 and press return]
  94.              -E02FD
  95.              NNNN:02FD 10.90  [Type the 90 and press return]
  96.              -W
  97.              Writing nnnn blocks
  98.              -Q
  99.              A>
  100.  
  101.         For instructions on using DEBUG, consult your DOS manual.
  102.  
  103.         Program  results will be unpredictable if the argument to 
  104.         the  program  is  not an  integer.   If  no  argument  is 
  105.         specified, the value defaults to 1 (one).
  106.  
  107. ACKNOWLEDGMENTS:   The   procedure   GetMax   is   adapted   from 
  108.         CMDLINE.PAS,  posted  on  FidoNet/FTL  by  Bruce  Webster 
  109.         (SYSOP).   The  procedure  SetErrlevel is adapted from  a 
  110.         program by Bruce Webster and myself.  Help in eliminating 
  111.         the screen clear instruction was provided by Bill  Parker 
  112.         of Ashton-Tate.