User Tools

Site Tools


running_a_bas_file_from_the_command_prompt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
running_a_bas_file_from_the_command_prompt [2019/04/26 16:34]
richardrussell
running_a_bas_file_from_the_command_prompt [2019/05/10 14:12] (current)
richardrussell Add to save the helper program from the IDE
Line 12: Line 12:
 But this only works when the program is in internal '​tokenised'​ format, i.e. a .BBC file.  If you attempt to use the same method to run a program in 'plain text' (.BAS) format you will receive a 'Bad program'​ error message. But this only works when the program is in internal '​tokenised'​ format, i.e. a .BBC file.  If you attempt to use the same method to run a program in 'plain text' (.BAS) format you will receive a 'Bad program'​ error message.
  
-Fortunately there is a relatively simple solution, by using a helper program. ​ Save the program listed below as **basrun.bbc**,​ then run the BAS file as follows:+Fortunately there is a relatively simple solution, by using a helper program. ​ Save the program listed below as **basrun.bbc**,​ then run the BAS file as follows ​(the quotes are important):
  
 <code dos> <code dos>
Line 19: Line 19:
 </​code>​ </​code>​
  
-Here is the helper program, save it as **basrun.bbc**:​+Here is the helper program, save it from the IDE as **basrun.bbc**:​
  
 <code bb4w> <code bb4w>
Line 33: Line 33:
  
       REM. Open BAS file:       REM. Open BAS file:
-      F% = OPENINMID$(@cmd$,​P%+1)+      F% = OPENIN MID$(@cmd$,​P%+1)
       IF F% = 0 ERROR 0, "​Couldn'​t open file " + MID$(@cmd$,​P%+1)       IF F% = 0 ERROR 0, "​Couldn'​t open file " + MID$(@cmd$,​P%+1)
  
running_a_bas_file_from_the_command_prompt.1556296443.txt.gz ยท Last modified: 2019/04/26 16:34 by richardrussell