home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / util1 / incx100b.lzh / INC-PROG.LZH / INC.BAT < prev    next >
DOS Batch File  |  1991-02-18  |  8KB  |  184 lines

  1. echo off
  2. cls
  3. goto start
  4. :usage
  5. echo .=================================================================
  6. echo .===== inc.bat -- Invoke InContext Work Environment Manager  =====
  7. echo .=====                                                       =====
  8. echo .===== usage:                                                =====
  9. echo .=====        inc [ -n ] [ -u initials ] [ dir ]             =====
  10. echo .=====                                                       =====
  11. echo .===== where:                                                =====
  12. echo .=====        -n    ignore mouse driver                      =====
  13. echo .=====        -u    select user by (three) initials          =====
  14. echo .=====                 (requires prior setup)                =====
  15. echo .=====        dir   InContext installation directory         =====
  16. echo .=====                                                       =====
  17. echo .===== examples:                                             =====
  18. echo .=====        inc                                            =====
  19. echo .=====        inc -n c:\myplace                              =====
  20. echo .=====        inc -u mar d:\incontxt                         =====
  21. echo .=====                                                       =====
  22. echo .=== Copyright 1991 Rams' Island Software All Rights Reserved ====
  23. echo .== 1991 Rams' Island Software, 8 Grand Place, Newtown CT 06470 ==
  24. echo .=================================================================
  25. echo .
  26. echo .
  27. goto done
  28.  
  29. rem ----- Check arguments -------------------------------------------
  30. :start
  31. if %1. == help.      goto usage
  32. if %1. == .          goto default
  33. goto do_inc
  34.  
  35. rem ----- If invoked without arguments, verify default --------------
  36. rem -----   installation (i.e., in c:\incontxt         --------------
  37. :default
  38. if not exist c:\incontxt\errmsg.dat goto nosuch
  39.  
  40. rem ===== Invoke InContext Work Environment Manager =================   
  41. :do_inc
  42. incontxt %1 %2 %3 %4
  43.  
  44. rem ----- Check returned error code ---------------------------------
  45. if errorlevel 99 goto error99
  46. if errorlevel 98 goto error98
  47. if errorlevel 9 goto error9
  48. if errorlevel 2 goto error2
  49. if errorlevel 1 goto error1
  50.  
  51. rem ===== Handle "unload" to invoke application =====================   
  52. rem =====                                                       =====
  53. rem =====   InContext uses a simple batch file "trick" to allow =====
  54. rem =====   it to completely unload itself before executing an  =====
  55. rem =====   application.  This is rarely necessary, because     =====
  56. rem =====   almost all applications can run "under" InContext.  =====
  57. rem =====   When an application needs ALL available memory,     =====
  58. rem =====   though, it can be invoked with a procedure that     =====
  59. rem =====   includes an "!unload" command (see User Guide for   =====
  60. rem =====   details).  When that is done, InContext will write  =====
  61. rem =====   a batch file and then terminate.  The batch file    =====
  62. rem =====   you're NOW reading detects the presence of that     =====
  63. rem =====   other batch file, invokes it, and then re-invokes   =====
  64. rem =====   InContext.                                          =====
  65. rem =====                                                       =====
  66. rem =====   If you don't use "unload", this batch file need not =====
  67. rem =====   be changed.  If you use the default location for    =====
  68. rem =====   the InContext installation directory (c:\incontxt)  =====
  69. rem =====   and for the temporary batch file (c:\temp.bat) that =====
  70. rem =====   InContext writes out, then this batch file should   =====
  71. rem =====   execute an "unload" correctly.  Otherwise, you will =====
  72. rem =====   need to make appropriate adjustments to the next    =====
  73. rem =====   five lines (not counting "rem" comment lines).      =====
  74.  
  75. rem ----- The next three lines must correctly reference the  --------
  76. rem ----- temporary batch file written by InContext.  The    --------
  77. rem ----- pathname of that file is set in Misc Options Exec. --------
  78. if not exist c:\temp.bat goto done
  79. call c:\temp.bat
  80. del c:\temp.bat
  81.  
  82. rem ----- The following two lines are necessary only if you do   ----
  83. rem ----- not have the incontxt.exe executable in your DOS path. ----
  84. rem ----- They are needed in order to restore the current        ----
  85. rem ----- working directory to the location of that file so that ----
  86. rem ----- it can be executed.                                    ----
  87. c:
  88. cd \incontxt
  89. goto do_inc
  90.  
  91. rem ===== Error Displays ============================================   
  92. :error1
  93. echo .
  94. echo .
  95. echo .
  96. echo Incontext was unable to continue because the swap file could not
  97. echo be read upon return from a subprogram.  Press any key and InContext
  98. echo will restart.
  99. pause
  100. goto do_inc
  101.  
  102. :error2
  103. echo .
  104. echo .
  105. echo .
  106. echo InContext was unable to continue because the swap file was deleted
  107. echo while executing a sub-program.  Press any key and Incontext will
  108. echo restart.
  109. pause
  110. goto do_inc
  111.  
  112. :error9
  113. echo .
  114. echo .
  115. echo .
  116. echo InContext was unable to continue because of an error in attempting
  117. echo to read the swap file back from EMS memory after returning from a
  118. echo subprogram.  You may be attempting to execute an ill-behaved EMS
  119. echo program.  It is suggested that you select the InContext option that
  120. echo disables its use of EMS memory for a swap file.  Press any key and
  121. echo InContext will restart.
  122. pause
  123. goto do_inc
  124.  
  125. :error98
  126. echo .
  127. echo .
  128. echo .
  129. echo InContext has incurred a memory allocation error.  While this may be
  130. echo caused by an internal program bug, it is much more likely that the
  131. echo user has selected options which exceed the amount of memory available.
  132. echo You may minimize memory usage by:
  133. echo    (1) not attempting to use the internal editor on extremely large
  134. echo        files.  Under "More Options Misc", set the "Limit editor to
  135. echo        files under (Kbytes)" option to a reasonably small value.
  136. echo        The internal editor is really intended only for use on relatively
  137. echo        small files (up to perhaps 32-64K).
  138. echo    (2) not logging all directories in all drives.  If you have many
  139. echo        disk drives, or a single drive with a very large number of
  140. echo        files and/or directories, you may need to use "Misc Options Disk"
  141. echo        to log one or more drives only "As Needed".
  142. echo .
  143. echo If you wish to prevent InContext from restarting, press Control-Break
  144. echo now.  Press any other key and InContext will restart.
  145. pause
  146. goto do_inc
  147.  
  148. :error99
  149. echo .
  150. echo .
  151. echo .
  152. echo InContext has incurred a fatal error.  The nature of the error is
  153. echo displayed just above.  If you are unable to determine and correct
  154. echo the cause of this error, please contact Rams' Island Software for
  155. echo assistance.  If you wish to prevent InContext from restarting, press
  156. echo Control-Break now.  Press any other key and InContext will restart.
  157. pause
  158. goto do_inc
  159.  
  160. :nosuch
  161. echo .
  162. echo .
  163. echo .
  164. echo You have invoked inc.bat with no arguments.  When inc.bat is used
  165. echo with no arguments, it assumes that you have installed InContext in
  166. echo the default directory (c:\incontxt).  However, inc.bat cannot find
  167. echo an InContext installation in that directory.  Perhaps you have
  168. echo chosen to install InContext in a different directory.  In that case,
  169. echo you need to specify the directory on the command line.  For example,
  170. echo if you installed the package in the directory D:\MYPLACE, you should
  171. echo invoke InContext with the command
  172. echo      inc d:\myplace
  173. echo .
  174. echo If, after reading this message, you still can't see how to proceed,
  175. echo it is suggested that you read the "Quick Start" section of the User
  176. echo Guide, in the file INCONTXT.DOC.
  177. echo .
  178. echo .
  179. echo .
  180. goto done
  181.  
  182. rem ===== Exit to DOS ===============================================   
  183. :done
  184.