Date : Sun, 02 Feb 1986 22:00:00 MST
From : Keith Petersen <W8SDZ@...>
Subject: Chaining programs by using a $$$.SUB file
The following program, BUILDSUB.BAS, illustrates how to create a
$$$.SUB file. It is intended to show how you can do this from within
your own Microsoft BASIC-80 program. In this illustration, only one
command, "DIR", is done. The program code would of course have to be
more complex if more than one command must be written to the submit
file. As mentioned before, the commands must be written one to each
128-byte record, in reverse order.
--Keith Petersen
Arpa: W8SDZ@...
GEmail: W8SDZ
uucp: {ihnp4,allegra,cmcl2,dual,decvax,mcnc,mcvax,vax135}!seismo!w8sdz
--cut here--
10 REM BUILDSUB.BAS by Keith Petersen, W8SDZ 1/24/81
20 REM This illustrates how to execute another program from
30 REM BASIC. The secret is setting up a submit file, which
40 REM CP/M then automatically executes when we leave this
50 REM program and return to CP/M.
60 OPEN "O",1,"A:$$$.SUB":REM This is the submit file
70 REM Now lets tell CP/M to do a "DIR" after we reboot.
80 REM This could just as well be a name of a .COM file
90 REM we want to execute.
100 PRINT #1,CHR$(3);"DIR";CHR$(0)
110 REM length of ^ the command string
120 REM the command ^^^ string
130 REM and a terminating zero ^
140 CLOSE
150 POKE 4,0 : REM Assure we are on drive A: so submit will work
160 SYSTEM