home *** CD-ROM | disk | FTP | other *** search
- ;;05-26-85
-
- GSUB.DOC v1.0
- 05/25/85
-
- Eric Gans
- French Dep't UCLA
- Los Angeles, CA 90024
-
- Why add another entry to the already crowded field of SUBMIT
- substitutes? Why not use EX? EX is a powerful program, but it
- has a major defect: it can't distinguish between console input
- within a program and input to the CCP. Thus it can't run a SUB
- file that contains a series of programs one of which allows
- console input; it just reads the rest of the SUB file into the
- program. For example, I use a little file Z.SUB for writing
- assembly language programs:
- ws $1.azm
- z80mr $1.bbz
- mload $1
-
- EX can't handle this; as soon as it gets into Wordstar it writes
- the other two lines into my source file instead of waiting to get
- back to the console. GSUB was written to solve this problem.
-
- GSUB, like EX, puts its command buffer in memory instead of
- in a $$$.SUB disk file. It allows:
-
- - internal program input separate from CCP input
- - run from command line or SUB file
- - variables ($1 - $9)
- - control characters
- - wait for console input
- - comments
-
- It is also smaller & faster than EX (or any other batch
- program I have seen). It not only traps Warm Boots but returns
- to the end rather than the beginning of the CCP (saves a second
- of looking on disk for $$$.SUB files). Its command buffer allows
- 256 characters (comments not included), or two sectors; v1.0x is
- 40-50 characters larger.
-
- Command syntax:
-
- (1) Command line: to run GSUB without a SUB file (for one-time
- use) you enter the command line as follows:
-
- gsub =cmd1[;{internal program commands}][cmd2][;...
-
- CCP commands (except the last in line) must be followed by ";",
- and internal commands must be within "{...}"
-
- $<ch> will take <ch> as a literal (i.e., to use "{" in the
- command line, write "${")
- ^<ch> will produce a control character
-
- Internal Commands (within {...})
-
- | = carriage return (0Dh = ^m)
- ~ waits for a character input
-
- Examples: gsub =ws;{nblurk.azm^m}era *.bak will enter WS & open
- the non-document file blurk.azm, then on exit erase the BAK
- file(s)
-
- gsub =ddt;{dd200|lea00~s100|42|4c|55|52|4b|.|^c}save 1 blurk
-
- will enter ddt, dump d200-, write out the command "lea00" and
- wait for you to type a key (e.g., a CR), then display the byte at
- 100H and enter five characters and a "." to end, exit with ^C and
- save the result. Note that except for the wait for input, the
- second example might have been accomplished (several times
- slower) with SUBMIT and XSUB, but not the first, since "n" in
- Wordstar is a character input that does not use CPM function 10
- (read console buffer).
-
-
- (2) File input:
-
- Variables: as in normal SUB files, variables should be numbered
- consecutively from $1 to $9.
-
- Each CCP command must be followed by a CRLF. Internal commands
- may include CRLF's also; usually a CR alone (|) suffices. The
- internal command line, if any, must end with a CRLF.
-
- Comment lines beginning with ";" will not be copied to the
- command buffer. You may also add comments after the end of the
- internal command line.
-
- $<ch> will produce a literal of <ch> for anything but the
- variables $1-$9.
-
- Otherwise, the $, ^, | and ~ symbols function as above.
-
- Examples:
-
- ws
- {nblurk.azm|}
- era *.bak
-
-
- ddt
- { .... } (as above)
- save 1 blurk
- [eof]
-
- Another way of entering a CR into the internal input is to go to
- the next line; the program kills the LF's that are usually
- misinterpreted by word-processors & other programs (Wordstar
- thinks you want to set the help level (^J):
-
- ;for the literary
- ws charlott.let
- {Liebchen, I can't live without you.
- Death is my only recourse.
- ;don't believe a word - The Editor
- - Werther
- ^kx} ;pretty hot stuff?
-
- To output control characters etc. to the screen, enter them as
- external commands (NOT within {...}):
-
- gsub =^g^z^[B0^[=00BLURK!^[C0^m
-
- will sound the bell (^g), then (on an ADM 3A) blank the screen,
- set inverse video, go sixteen lines down and sixteen across,
- print BLURK!, then turn off inverse video and do a CR (you can't
- use | here).
-