EasyManua.ls Logo

Epson PX-8 - Page 67

Epson PX-8
168 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
3.8.5
SUBMIT/XSUB
Two very useful commands available in
CP
1M
are SUBMIT and XSUB. Sup-
pose you wish to execute the same commands in a certain sequence
at
various
times. Instead
of
having to type in the commands one by one you can put them
all into a special file with the extension .SUB. Then when you want
that
series
of
commands executed you can simply type
C>
SUBMIT filename
and they will all be executed one by one. You can use the XSUB command
to allow for input from the keyboard when running programs listed in the SUB-
MIT file by inserting it
at
the beginning
of
the file.
The most useful aspect
of
having a SUBMIT file facility in
CP
1M
on
the PX-8
is
to enable a whole sequence
of
files to be run from
an
AUTOST ART
or
WAKE
string. Section 2.2.3 shows how to set
up
these strings.
1. SUBMIT
First
of
all you need to make a list
of
the programs you want to run. These
must all be programs which will return to the
CP
1M
system
prompt
when they
end because otherwise the next command in the sequence cannot be executed.
It
is
possible
to
run
other types
of
programs,
or
ones which require input from
the keyboard, providing you are present
to
type in
at
the keyboard when
necessary.
The files containing the commands can be created in a variety
of
ways - any
word processing program such as Portable WordStarâ„¢, a BASIC program
or
using the
CP
1M
ED
program
if
you have it.
Here
is
an
example
of
a simple batch
of
jobs
to
be carried out:
1.
Display a directory
of
the disk
on
the D: drive;
2. Show the sizes
of
the files;
3. Erase all those with the extension .BAK (that is, back-up files);
4. Move all BASIC files to the disk in the E: drive.
The sequence
of
commands to do this would be:
DIRD:
STAT
D:*.*
3-54
ERA
D:*.BAK
PIP
E: =
D:
* .BAS
If
this series
of
commands were held in a file called START .SUB the command
to execute them will be:
A>
SUBMIT START
The commands will be executed one by one, and each one will be shown
on
the screen before it
is
run, just as
if
you had typed it in from the keyboard.
If
you want
to
run
a BASIC program from SUBMIT, remember that when such
a program ends
it
returns to the BASIC
'Ok'
prompt
instead
of
to
CP/M,
so
the next command in the SUBMIT file will not be executed. One way round
this
is
to
insert a line in the program:
65989 SYSTEM
This will ensure a return
to
CP
1M
at the end
of
the program.
If
one
or
more
of
the progams you want to be executed may vary, it
is
possible
to insert variables into the SUBMIT file which can be substituted when the sub-
mit program
is
run. The variables symbols are inserted in the form
"$1",
"$2",
"$3"
etc, where
"$1"
is
the variable symbol used for the first substitution,
"$2"
for the second and so on. The values
of
the variables are substituted ac-
cording
to
the following syntax:
C>
SUBMIT filename
Xl
X2 X3 ..•..
where
Xl
will substitute all values
of
"$1",
X2 all values
of
"$2"
and so on.
For
instance
if
the SUBMIT file BEGIN .SUB contained
DIR
D:*.BAS
B:BASIC
$1
STAT D: * .BAS
the command given could be
C>SUBMIT
BEGIN
D:PROGI
3-55

Other manuals for Epson PX-8

Related product manuals