home *** CD-ROM | disk | FTP | other *** search
/ terabyteunlimited.com / 2014.06.terabyteunlimited.com.tar / terabyteunlimited.com / MSGBOXT.ZIP / README.TXT < prev    next >
Text File  |  2006-05-03  |  5KB  |  152 lines

  1. Description
  2. ~~~~~~~~~~~
  3. MSGBOX is a simple DOS utility to display a message box and wait for
  4. input from the user.   You would typically use this in a batch file
  5. with ERRORLEVEL to determine the user's response.
  6.  
  7. Installation
  8. ~~~~~~~~~~~~
  9. Besides the batch file(s) themselves, using MSGBOX requires at least
  10. two files: MSGBOX.EXE and MSGBOX.TXT.  MSGBOX.EXE is the program
  11. itself, and MSGBOX.TXT is the file used to store the message to be
  12. displayed to the user.  More information on the function of MSGBOX.TXT
  13. is provided in the Usage section below.
  14.  
  15. Place MSGBOX.EXE and MSGBOX.TXT in one or more folders on your hard
  16. drive, or on a floppy diskette, depending on what path(s) will be
  17. accessible when you run MSGBOX.EXE from your batch file.
  18.  
  19. Note: When MSGBOX.EXE is run, it looks for MSGBOX.TXT in the current
  20. directory of the DOS environment.  Therefore, MSGBOX.EXE and MSGBOX.TXT
  21. need not be in the same folder, and you may use multiple copies of
  22. MSGBOX.TXT, if desired.
  23.  
  24. Usage
  25. ~~~~~
  26. Please refer to the MSGBOX.TXT and SAMPLE.BAT example, which is
  27. included in this package.
  28.  
  29. MSGBOX.TXT is used to specify the message to be displayed to the user.
  30. MSGBOX.TXT can optionally be used to specify the colors of the message
  31. box dialog as well.
  32.  
  33. To set up MSGBOX.TXT, simply enter the text that is appropriate for the
  34. question being asked of the user, and list the valid response characters.
  35.  
  36. You can enclose a string in a pair of ~ characters to highlight text.
  37.  
  38. The colors of the message box, message box text, and input area can be
  39. specified in MSGBOX.TXT.  To specify colors, use the following format,
  40. and put the line at the top of MSGBOX.TXT:
  41.  
  42. %box%=0xFFFF %text%=0xFFFF %input%=0xFFFF
  43.  
  44. Each FFFF represents the applicable character's normal and highlight
  45. colors.  The list of available colors is as follows:
  46.  
  47. Black ........... 0
  48. Blue ............ 1
  49. Green ........... 2
  50. Cyan ............ 3
  51. Red ............. 4
  52. Magenta ......... 5
  53. Brown ........... 6
  54. Light Gray ...... 7
  55. Dark Gray ....... 8
  56. Light Blue ...... 9
  57. Light Green ..... A
  58. Light Cyan ...... B
  59. Light Red ....... C
  60. Light Magenta ... D
  61. Yellow .......... E
  62. White ........... F
  63.  
  64. Command line format for MSGBOX.EXE:
  65.  
  66. MSGBOX chars
  67.  
  68. Where "chars" represents a string of valid response characters.  Note:
  69. Be sure to specify the valid response characters in MSGBOX.TXT,
  70. according to what you use in the MSGBOX.EXE command line.
  71.  
  72. ERRORLEVEL is set to a number that equates to the position of the
  73. character that was entered.  Numbering begins at 1.  For example, if
  74. the characters supplied were YNC (i.e. a command line of "MSGBOX YNC"),
  75. then pressing Y would set ERRORLEVEL to 1, pressing N would set
  76. ERRORLEVEL to 2, and pressing C would set ERRORLEVEL to 3.
  77.  
  78. Note that for any n value that ERRORLEVEL is set to, ERRORLEVEL n-1
  79. will also be true.  For example, if ERRORLEVEL is 4, then testing it
  80. against 3, 2, 1, and 0 will also be true.  For this reason, you must
  81. always test ERRORLEVEL in reverse order.  For example:
  82.  
  83. if errorlevel 3 goto :error3
  84. if errorlevel 2 goto :error2
  85. if errorlevel 1 goto :error1
  86.  
  87. If you were to evaluate ERRORLEVEL the other way around, then the batch
  88. file would branch to the :error1 label, even if ERRORLEVEL were equal
  89. to 2 or 3.
  90.  
  91. Additional Usage Information
  92. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  93. If you wish to use MSGBOX more than once, there are a couple different
  94. ways you can make it work:
  95.  
  96. 1. You could keep separate customized copies of MSGBOX.TXT in different
  97. folders, and change the current directory before invoking MSGBOX.EXE,
  98. to point to the correct MSGBOX.TXT.  For example:
  99.  
  100. @echo off
  101. cd YNCdir\
  102. ..\msgbox ~YNC~
  103. if errorlevel 3 goto :cancel
  104. if errorlevel 2 goto :no
  105. if errorlevel 1 goto :yes
  106. cd ECdir\
  107. ..\msgbox ~EC~
  108. if errorlevel 2 goto :continue
  109. if errorlevel 1 goto :exit
  110.  
  111. The example above assumes that the files YNCdir\MSGBOX.TXT and
  112. ECdir\MSGBOX.TXT each exist.  It also assumes that the labels called
  113. (i.e. :cancel, :no, :yes, :continue, and :exit) exist elsewhere in the
  114. batch file.
  115.  
  116. The "..\" is used when MSGBOX.EXE is invoked because of the assumption
  117. that MSGBOX.EXE resides in the initial current directory.  For example,
  118. if you began in A:\ and issued the command "cd YNCdir\", issuing the
  119. command "..\msgbox ~YNC~" would attempt to run MSGBOX.EXE from A:\,
  120. because the "..\" has the effect of moving up one folder level, in this
  121. case from A:\YNCdir\ to A:\.
  122.  
  123. 2. You could keep separate text files with customized MSGBOX.TXT content
  124. in each, and then copy each text file to a single copy of MSGBOX.TXT
  125. whenever needed.  For example:
  126.  
  127. @echo off
  128. copy yesno.txt msgbox.txt
  129. msgbox ~YN~
  130. if errorlevel 2 goto :no
  131. if errorlevel 1 goto :yes
  132. copy exitcont.txt msgbox.txt
  133. msgbox ~EC~
  134. if errorlevel 2 goto :continue
  135. if errorlevel 1 goto :exit
  136.  
  137. The example above copies the content of YESNO.TXT and EXITCONT.TXT into
  138. a single copy of MSGBOX.TXT, each at the appropriate time.  The example
  139. assumes that the labels called (i.e. :no, :yes, :continue, and :exit)
  140. exist elsewhere in the batch file.
  141.  
  142. The example above assumes that MSGBOX.EXE resides either in a folder
  143. found in the PATH environment variable, or in the current directory.
  144.  
  145. License
  146. ~~~~~~~
  147. See the FWLIC.TXT file included with this package.
  148.  
  149. Copyright
  150. ~~~~~~~~~
  151. Copyright (c) 2004-2005, TeraByte, Inc.  All Rights Reserved.
  152.