home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / a / batch.lbr / BATCH+.DQC / BATCH+.DOC
Encoding:
Text File  |  1993-03-31  |  7.4 KB  |  202 lines

  1.  
  2.  
  3.                BATCH PLUS
  4.           Conditional SUBMIT Utilities
  5.               for CP/M Plus
  6.  
  7.               Gene Pizzetta
  8.               May 27, 1987
  9.  
  10.  
  11. CP/M Plus has three system batch facilities: GET, SUBMIT, and the 
  12. ability to enter multiple commands at the system prompt.  Two of 
  13. these--SUBMIT and multiple commands--also offer conditional 
  14. execution, but it's a seldom used feature because no programs 
  15. that I know of take advantage of it (other than SLR's 
  16. assemblers).  Even DRI's supplied utilities, such as MAC and 
  17. RMAC, do not send the proper error codes to the BDOS to use them 
  18. in conditional batch operations.
  19.  
  20. Conditional batch commands are entered with a colon (":") 
  21. immediately in front of them.  They are not executed if the 
  22. preceding program sends a "failure" code to the BDOS.
  23.  
  24. This package includes three small utilities that make conditional
  25. batch jobs a little more convenient to implement.
  26.  
  27. IF sends a failure code to the BDOS if a specified file DOES NOT
  28. exist on a specified drive.  In other words, if the file exists,
  29. the following conditional command is executed; the conditional
  30. command is skipped if the file does not exist.
  31.  
  32. IFNOT sends a failure code to the BDOS if a specified file DOES
  33. exist on a specified drive.  In other words, if the file exists,
  34. the following conditional command is skipped; the conditional
  35. command is executed if the file does not exist.
  36.  
  37. WAIT rings the terminal bell and waits for the input of a 
  38. character before continuing.    Entering a ^C will cause a 
  39. failure code to be send to then BDOS and the following 
  40. conditional command will be skipped.  Any other key will cause 
  41. the batch operation to continue normally.
  42.  
  43. These SUBMIT utilities will work from .SUB files, from multiple 
  44. command lines, and from command files created by CHN, another 
  45. CP/M+ batch utility I have released to the public domain.  All of 
  46. them tell you what they found or didn't find and what the result 
  47. is before they exit.
  48.  
  49. The CP/M Plus (CP/M 3.0) operating system and a Z80 CPU are 
  50. required for BATCH PLUS utilities.
  51.  
  52.  
  53.  
  54.                    IF
  55.                Version 1.0
  56.               May 25, 1987
  57.  
  58.  
  59. USAGE:
  60.  
  61.      IF {d:}<fn.ft>
  62.  
  63. If a drive specification is not given, the default drive is as
  64. sumed.    If a filename is not given, "No Filename Specified" will
  65. be reported and a "failure" code will be sent to the BDOS.  If
  66. the specified file is not found on the drive, or if the file is a
  67. zero length file, the situation will be reported and a "failure"
  68. code will be sent to the BDOS.    If the file is found and it is
  69. not zero length, "success" will be reported and no return code
  70. will be sent to the BDOS.  If a "failure" code is received by the
  71. BDOS, the following conditional command will not be executed.
  72.  
  73. To put this in plain English, if the specified file exists then
  74. the following conditional command will be executed:
  75.      if filename [exists]!:command [will be executed]
  76.  
  77. A zero-length file is considered not to exist.
  78.  
  79.  
  80.  
  81.                   IFNOT
  82.                Version 1.0
  83.               May 25, 1987
  84.  
  85.  
  86. USAGE:
  87.  
  88.      IFNOT {d:}<fn.ft>
  89.  
  90. If a drive specification is not given, the default drive is as
  91. sumed.    If a filename is not given, "No Filename Specified" will
  92. be reported and a "failure" code will be sent to the BDOS.  If
  93. the file is found and it is not zero length, "File Found" will be
  94. reported and a "failure" code will be sent to the BDOS.  If the
  95. specified file is not found on the drive, or if the file is a
  96. zero length file, the situation will be reported and no return
  97. code will be sent to the BDOS.
  98.  
  99. In other words, if the specified file does not exist then the
  100. following conditional command will be executed:
  101.      IFNOT filename [does not exist]!:command [will be executed]
  102.  
  103. A zero-length file is considered not to exist.
  104.  
  105.  
  106.  
  107.                   WAIT
  108.                Version 1.0
  109.               May 26, 1987
  110.  
  111.  
  112. USAGE:
  113.  
  114.      WAIT
  115.  
  116. No command line parameters are needed or accepted.
  117.  
  118. WAIT rings the terminal bell and pauses, waiting for a key to be
  119. pressed on the console.  A ^C will cause a failure code to be
  120. sent to BDOS.  Any other key [except ^S, ^Q, ^P (see below)] will
  121. cause WAIT to exit normally.
  122.  
  123. The purpose of this program is to allow pauses during the 
  124. execution of SUBMIT's and multiple command lines, optionally 
  125. control ling the execution of conditional commands under CP/M 
  126. Plus.  Thus, if you press ^C in answer to WAIT's prompt, any 
  127. conditional command immediately following WAIT will not be 
  128. executed.
  129.  
  130. The three control keys intercepted by the BDOS (^S, ^Q, and ^P)
  131. will not be passed to WAIT, so other keys will have to be used.
  132. However, pressing ^P will cause printer echo to be toggled on or
  133. off, so WAIT can also be used merely to be able to start or stop
  134. printer echo, if you wish.  To do that you must first press ^S,
  135. then ^P, and finally ^Q.  After finishing that sequence, you
  136. still have to press another key before WAIT will continue.
  137.  
  138.  
  139.  
  140.                BATCH PLUS EXAMPLES
  141.  
  142.  
  143. I have a PROFILE.SUB, executed everytime my machine is booted.
  144. It loads about 15 frequently used utilities to my RAM disk.
  145. Unfortunately it also reloads by RAM disk everytime I hit reset
  146. because some program I'm testing crashes the system.  Now the
  147. PROFILE.SUB contains this two command sequence:
  148.      ifnot m:d.com
  149.      :pip
  150.      >m=a:d.com
  151.      ...
  152. D.COM is one of the utilities I ALWAYS have on my RAM disk (drive
  153. M), so PIP is only called if it's not there.
  154.  
  155. Similarly, when I use WordStar I have a CHN command file to load
  156. the overlays and document file to the RAM disk, set my function
  157. keys, and call WS.COM.  That's fine when I haven't previously
  158. used WordStar during that session.  But if I left WordStar and did
  159. something else for a while, I couldn't use the command file or it
  160. would  waste  my time copying the overlay files again.     Now  the
  161. command file has been changed:
  162.      ifnot m:ws.ovr!:pip m:=a:*.ovr! ...
  163. If the overlays are already there then the copy is skipped.
  164.  
  165. I have a special assembler CHN command file that makes sure I'm
  166. assembling to the RAM disk and checks to make sure the .ASM file
  167. exists there before calling MAC.  This has saved me some time
  168. occasionally:
  169.      m:!if m:$1.asm!:mac $1
  170. I call this command file with the command "ASM filename".
  171.  
  172. WAIT has many possible uses.  If you're printing a series of
  173. files from a .SUB file, for instance:
  174.      pip lst:=file1
  175.      wait
  176.      pip lst:=file2
  177.      wait
  178.      ...
  179. you can press the formfeed button after each file before starting
  180. the next one.
  181.  
  182. Since RMAC doesn't send a "failure" code, you might find the
  183. following batch useful:
  184.      rmac $1!wait!:link $1,stdlib.irl[s]
  185. If RMAC finds errors, you press ^C when WAIT asks for a key and
  186. you won't have to suffer through an unnecessary linkage.
  187.  
  188. I can think of other enhancements to this set of utilities, but 
  189. it's a start.  Within a few months I hope to add batch utilities 
  190. to completely abort a SUBMIT under CP/M Plus and for handling 
  191. CP/M 2.2 programs that try to abort the SUBMIT by erasing $$$.SUB 
  192. from drive A.  I already know how to do both of these things, so 
  193. it's just a matter of finding the time to write the programs.
  194.  
  195. Please send me any suggestions you might have for improvements
  196. and, especially, bug reports:
  197.  
  198.      Gene Pizzetta           CompuServe:    72060,505
  199.      481 Revere Street           Q-Link:  GeneP
  200.      Revere, MA  02151           GEnie:  E.Pizzetta
  201.      Voice: (617) 284-0891
  202.