This has the effect
of
inserting the filename you have given (D:PROG1) into
the variable
"$1"
in the SUBMIT file. The result would be to display a direc-
tory
of
the disk in drive B: and then load BASIC from drive
B:
before running
the BASIC program
PROG
1
on
the disk in drive D: and then showing the BASIC
files
on
drive D:.
There can be any number
of
variables in the SUBMIT file, and you must en-
sure
that
the filenames you give are in the correct order to be substituted
at
the appropriate time.
For
instance,
if
you have a SUBMIT file TESTING .SUB
containing the following commands:
DIR
$1
DIR
$2
STAT
$3
DIR
the command you give
to
execute it with the .COM files TESTA, TESTB and
TESTC in
that
order should be:
C>SUBMIT
TESTING TESTA TESTB TESTC
so
that
they are substituted in the correct order.
Some
CP/M
programs
(PIP
for example) use the
"$"
character in their sub-
commands, and
if
this will mean they will be interpreted as variables. Conse-
quently care must
be
taken as follows to overcome this by adding
an
extra
"$"
whenever the subcommand uses a
"$".
SUBMIT will then ignore the first one
and then treat the second one as normal.
For
example to insert the command
to
cause STAT to set all files
on
disk A: as Read/Only use:
STAT
A:*.*
$$R/O
WARNING:
The
SUBMIT
program writes a temporary file when it runs. This file will
be written to drive
A:
and
if
the disk is write protected,
an
error will be
generated and
you
will
not
be able to proceed further. Similarly
if
the
RAM
disk
A:
is set to zero bytes a
"DIRECTORY
FULL"
error will be
generated.
3-56
~
-'~
:~
1.-. 1.1. Creating a SUBMIT file in BASIC
-,
--
~
Since the PX-S
is
not supplied with the
CP/M
program ED, and you may not
W"J
r have a wordprocessor program, BASIC may be the only means
of
creating a
.,
r
'~..
SUBMIT file. This can be done very simply by creating a sequential text file
and writing the commands to it as data. Chapter 5
of
the BASIC Reference
;,
I
~
Manual gives details
of
creating text files.
For
instance, the series
of
commands
~
1 given above could be put into the file called START.SUB with the following
'VJ
("
"Ill'
I
.~
e~
I
/~
,.\
.~
,.,.
I
~
'-'/
I
~
~
.~
- I
/''"\
C
Y'
I "
~
I Y
~
J
~l~
~L
j
~
--:j
eL~
~
t,",
;L~
~l~
;
L,?
;L~
;:
L'"'"\
~~
~.".~
:~
program:
10
OPEN
"0",
#
1,
"D:START.SUB"
20
PRINT
#
1,
"DIR
D:"
30
PRINT
#
1,
"STAT
D:
*.
* "
40
PRINT
#
1,
"ERA
D: * .BAK"
50
PRINT
#
1,
"PIP
E: = D: *
.BAS"
60 CLOSE
70
END
Or, put another way:
10
OPEN
"0",
#
1,
"D:START.SUB"
20 READ A$
30 IF A$
=
"END"
THEN
60
40
PRINT
#
1,
A$
50 GOTO 20
60 CLOSE
70
END
S0
DATA
"DIR
D:",
"STAT
D:
*.
*
'~'ERA
D:
*
.BAK'~'PIP
E: =
D:
*.B
AS'~'END"
Either
of
these programs will create a file called START.SUB containing the
commands you want which can then be executed from the
CP/M
prompt by
typing:
C>SUBMIT
d:START
You could even write a utility program in BASIC
to
allow you to create a SUB-
MIT
file at any time by putting in the commands as you go and then storing
them in a .SUB file
of
your choice:
10
INPUT
"Type
in drivename and filename
";F$
20
OPEN
"0",
#
1,
F$ +
".SUB"
30
INPUT
"Enter
command
or
END
";A$
3-57