home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / basic / buildsub.bas < prev    next >
Encoding:
BASIC Source File  |  1984-09-03  |  689 b   |  17 lines

  1. 10 REM BUILDSUB.BAS by Keith Petersen, W8SDZ 1/24/81
  2. 20 REM This illustrates how to execute another program from
  3. 30 REM BASIC. The secret is setting up a submit file, which
  4. 40 REM CP/M then automatically executes when we leave this
  5. 50 REM program and return to CP/M.
  6. 60 OPEN "O",1,"A:$$$.SUB":REM This is the submit file
  7. 70 REM Now lets tell CP/M to do a "DIR" after we reboot.
  8. 80 REM This could just as well be a name of a .COM file
  9. 90 REM we want to execute.
  10. 100 PRINT #1,CHR$(3);"DIR";CHR$(0)
  11. 110 REM length of ^ the command string
  12. 120 REM the command   ^^^  string
  13. 130 REM and a terminating zero  ^
  14. 140 CLOSE
  15. 150 POKE 4,0 : REM Assure we are on drive A: so submit will work
  16. 160 SYSTEM
  17.