home *** CD-ROM | disk | FTP | other *** search
-
-
- BATCH PLUS
- Conditional SUBMIT Utilities
- for CP/M Plus
-
- Gene Pizzetta
- May 27, 1987
-
-
- CP/M Plus has three system batch facilities: GET, SUBMIT, and the
- ability to enter multiple commands at the system prompt. Two of
- these--SUBMIT and multiple commands--also offer conditional
- execution, but it's a seldom used feature because no programs
- that I know of take advantage of it (other than SLR's
- assemblers). Even DRI's supplied utilities, such as MAC and
- RMAC, do not send the proper error codes to the BDOS to use them
- in conditional batch operations.
-
- Conditional batch commands are entered with a colon (":")
- immediately in front of them. They are not executed if the
- preceding program sends a "failure" code to the BDOS.
-
- This package includes three small utilities that make conditional
- batch jobs a little more convenient to implement.
-
- IF sends a failure code to the BDOS if a specified file DOES NOT
- exist on a specified drive. In other words, if the file exists,
- the following conditional command is executed; the conditional
- command is skipped if the file does not exist.
-
- IFNOT sends a failure code to the BDOS if a specified file DOES
- exist on a specified drive. In other words, if the file exists,
- the following conditional command is skipped; the conditional
- command is executed if the file does not exist.
-
- WAIT rings the terminal bell and waits for the input of a
- character before continuing. Entering a ^C will cause a
- failure code to be send to then BDOS and the following
- conditional command will be skipped. Any other key will cause
- the batch operation to continue normally.
-
- These SUBMIT utilities will work from .SUB files, from multiple
- command lines, and from command files created by CHN, another
- CP/M+ batch utility I have released to the public domain. All of
- them tell you what they found or didn't find and what the result
- is before they exit.
-
- The CP/M Plus (CP/M 3.0) operating system and a Z80 CPU are
- required for BATCH PLUS utilities.
-
-
-
- IF
- Version 1.0
- May 25, 1987
-
-
- USAGE:
-
- IF {d:}<fn.ft>
-
- If a drive specification is not given, the default drive is as
- sumed. If a filename is not given, "No Filename Specified" will
- be reported and a "failure" code will be sent to the BDOS. If
- the specified file is not found on the drive, or if the file is a
- zero length file, the situation will be reported and a "failure"
- code will be sent to the BDOS. If the file is found and it is
- not zero length, "success" will be reported and no return code
- will be sent to the BDOS. If a "failure" code is received by the
- BDOS, the following conditional command will not be executed.
-
- To put this in plain English, if the specified file exists then
- the following conditional command will be executed:
- if filename [exists]!:command [will be executed]
-
- A zero-length file is considered not to exist.
-
-
-
- IFNOT
- Version 1.0
- May 25, 1987
-
-
- USAGE:
-
- IFNOT {d:}<fn.ft>
-
- If a drive specification is not given, the default drive is as
- sumed. If a filename is not given, "No Filename Specified" will
- be reported and a "failure" code will be sent to the BDOS. If
- the file is found and it is not zero length, "File Found" will be
- reported and a "failure" code will be sent to the BDOS. If the
- specified file is not found on the drive, or if the file is a
- zero length file, the situation will be reported and no return
- code will be sent to the BDOS.
-
- In other words, if the specified file does not exist then the
- following conditional command will be executed:
- IFNOT filename [does not exist]!:command [will be executed]
-
- A zero-length file is considered not to exist.
-
-
-
- WAIT
- Version 1.0
- May 26, 1987
-
-
- USAGE:
-
- WAIT
-
- No command line parameters are needed or accepted.
-
- WAIT rings the terminal bell and pauses, waiting for a key to be
- pressed on the console. A ^C will cause a failure code to be
- sent to BDOS. Any other key [except ^S, ^Q, ^P (see below)] will
- cause WAIT to exit normally.
-
- The purpose of this program is to allow pauses during the
- execution of SUBMIT's and multiple command lines, optionally
- control ling the execution of conditional commands under CP/M
- Plus. Thus, if you press ^C in answer to WAIT's prompt, any
- conditional command immediately following WAIT will not be
- executed.
-
- The three control keys intercepted by the BDOS (^S, ^Q, and ^P)
- will not be passed to WAIT, so other keys will have to be used.
- However, pressing ^P will cause printer echo to be toggled on or
- off, so WAIT can also be used merely to be able to start or stop
- printer echo, if you wish. To do that you must first press ^S,
- then ^P, and finally ^Q. After finishing that sequence, you
- still have to press another key before WAIT will continue.
-
-
-
- BATCH PLUS EXAMPLES
-
-
- I have a PROFILE.SUB, executed everytime my machine is booted.
- It loads about 15 frequently used utilities to my RAM disk.
- Unfortunately it also reloads by RAM disk everytime I hit reset
- because some program I'm testing crashes the system. Now the
- PROFILE.SUB contains this two command sequence:
- ifnot m:d.com
- :pip
- >m=a:d.com
- ...
- D.COM is one of the utilities I ALWAYS have on my RAM disk (drive
- M), so PIP is only called if it's not there.
-
- Similarly, when I use WordStar I have a CHN command file to load
- the overlays and document file to the RAM disk, set my function
- keys, and call WS.COM. That's fine when I haven't previously
- used WordStar during that session. But if I left WordStar and did
- something else for a while, I couldn't use the command file or it
- would waste my time copying the overlay files again. Now the
- command file has been changed:
- ifnot m:ws.ovr!:pip m:=a:*.ovr! ...
- If the overlays are already there then the copy is skipped.
-
- I have a special assembler CHN command file that makes sure I'm
- assembling to the RAM disk and checks to make sure the .ASM file
- exists there before calling MAC. This has saved me some time
- occasionally:
- m:!if m:$1.asm!:mac $1
- I call this command file with the command "ASM filename".
-
- WAIT has many possible uses. If you're printing a series of
- files from a .SUB file, for instance:
- pip lst:=file1
- wait
- pip lst:=file2
- wait
- ...
- you can press the formfeed button after each file before starting
- the next one.
-
- Since RMAC doesn't send a "failure" code, you might find the
- following batch useful:
- rmac $1!wait!:link $1,stdlib.irl[s]
- If RMAC finds errors, you press ^C when WAIT asks for a key and
- you won't have to suffer through an unnecessary linkage.
-
- I can think of other enhancements to this set of utilities, but
- it's a start. Within a few months I hope to add batch utilities
- to completely abort a SUBMIT under CP/M Plus and for handling
- CP/M 2.2 programs that try to abort the SUBMIT by erasing $$$.SUB
- from drive A. I already know how to do both of these things, so
- it's just a matter of finding the time to write the programs.
-
- Please send me any suggestions you might have for improvements
- and, especially, bug reports:
-
- Gene Pizzetta CompuServe: 72060,505
- 481 Revere Street Q-Link: GeneP
- Revere, MA 02151 GEnie: E.Pizzetta
- Voice: (617) 284-0891