The resulting program has no immediate (command) mode and other programs cannot be LOADed, SAVEd, LISTed, EDITed, etc. However, the CHAIN command is available so programs consisting of multiple modules or overlays are still possible.
When the BBCBASIC program terminates with END or STOP, or simply 'falls of the end', the program is exited and control returned to MS-DOS. Similarly, if an untrapped or untrappable error occurs, the error message is printed and control is returned to MS-DOS.
The following commands do not exist:
If they are encountered in a BBC BASIC program they cause a 'Syntax error'.
AUTO DELETE EDIT LIST LISTO LOAD NEW OLD RENUMBER SAVE EDIT
If you wish you can CRUNCH or UNLIST your program as it is combined into the .EXE file. Your original program is not affected in any way.
BBCRUN (BIGRUN) uses the PATH parameter in the environment. Unlike MS-DOS (PC DOS), an error will result if any elements of the PATH do not exist or cannot be accessed. If you get a 'Bad directory' error, check that your PATH is valid.
You can find out the current settings for COMSPEC and PATH by typing:
at the DOS prompt.SET<Enter>
The easiest way to create a suitable character font file is to write a short BBCBASIC(86) program to define the characters (using VDU 23...) and then save the memory image with *SAVE USERFONT 500 +400.
BBCRUN (BIGRUN) simply puts this file in the appropriate place in the final .EXE file.10 VDU 23,129,24,36,66,255,24,24,24,255 20 VDU 23,130,24,60,126,255,24,24,255,255 etc 120 *SAVE USERFONT 500 +400
For testing with BBCBASIC or BIGBASIC, you can *LOAD this file to address 500 by hand.
In order for this font data to be recognised, at least one character must be defined conventionally in the main program using VDU 23; if this is not done, the data in the file will be ignored. In the above example, character 128 would be defined by the program.
To access the command line, the first line of the program should copy this fixed string to a conventional string variable.
This is necessary because &100 is the 'string accumulator' and it is used by BBCBASIC(86) as a scratchpad during the processing of several statements.10 command$=$&100
Since this line will not be meaningful if executed under BBCBASIC or BIGBASIC, it should be replaced while testing by a line of the form:
When the program has been thoroughly tested the line can be changed prior to executing BBCRUN (BIGRUN).10 INPUT command$
The string at &100 will contain the entire command tail except for any re-direction or pipe commands (and the /nnn parameter to determine the amount of RAM for BIGBASIC).
If, for example, a program was run with the following command line:
The string at &100 would contain 'ONE TWO THREE'. Of course, the >NUL would have no effect unless *OPT 3 is present in the program since BBCBASIC(86) does not, by default, use MS-DOS for console output.C>DEMO ONE TWO THREE >NUL
The BBCBASIC(86) program is not checked to see whether it contains anything which is incompatible with the run-only version, such as one of the commands mentioned previously. It is up to you to make these checks and you can easily do so using the LIST IF command.
After prompting for the program name, BBCRUN (BIGRUN) asks for the name of the optional font definition file. If you do not want to load a character font definition file, simply press <Enter>. Building a font definition file is described earlier in the User Defined Characters sub-section'.
Next, BBCRUN (BIGRUN) asks whether you want to CRUNCH the program. This is generally a good thing to do, because it both shortens the executable file and makes it run more quickly. The only occasions when you would not want to run CRUNCH are when the program is incompatible with this process, for example if it refers to variables by name in DATA statements or using the EVAL function, or uses calculated line numbers in GOTO, GOSUB or RESTORE statements.
If you answer 'Y' to this prompt, the standard CRUNCH utility is invoked. If CRUNCH.COM is not found in the current search path, an error will be reported and BBCRUN (BIGRUN) will abort without building the .EXE file.
If you have chosen not to CRUNCH your program, you are asked whether you want to UNLIST it. This does not shorten the program or make it run any faster, but may be a useful precaution if you want to make it as difficult as possible for someone else to examine your code; it also eliminates the line numbers from any error messages. If you answer 'Y' to this prompt, the standard UNLIST utility is invoked. If UNLIST.COM is not found in the current search path, an error will be reported and BBCRUN (BIGRUN) will abort without building the .EXE file.
If you wish to CRUNCH or UNLIST your program, CRUNCH.COM or UNLIST.COM as appropriate must be in the current search path. The computer will also need to be able to find COMMAND.COM. See the Operating System Interface section for an explanation of why and how.
You will also need access to the BBCBASIC(86) program you wish to convert to an executable file. Life is easier if this program file is in the current directory.
Finally, if you wish to add a font definition file, you will need access to it. Once again, it is easier if this file is in the current directory.
The program will prompt you with the following lines:BBCRUN<Enter> or BIGRUN /99<Enter>
Enter name of BBCBASIC program:If BBCRUN cannot find any of the files you specify, it will abort with a 'File filename not found' error message without building the .EXE file.
Enter name of user defined character font file (if any):
Do you want to CRUNCH the program?
Do you want to UNLIST the program?
The original program is unaltered even if you asked for the program to be CRUNCHed or UNLISTed. If you asked for the program to be CRUNCHed and CRUNCH.COM is not in the current search path, BBCRUN (BIGRUN) aborts with the 'Crunch failed' error message without building the .EXE file. If you asked for the program to be UNLISTed and UNLIST.COM is not in the current search path, BBCRUN (BIGRUN) aborts with the 'Unlist failed' error message without building the .EXE file.
If a .EXE file with the program name already exists, you will be asked:
File progname.EXE exists, delete it ?If you answer 'N', BBCRUN (BIGRUN) terminates with the message 'Finished' without building the .EXE file.
When BBCRUN (BIGRUN) has finished it returns to MS-DOS with the message 'Finished'. and the normal MS-DOS prompt is displayed. The file progname.EXE now exists in the current directory and may be run by entering
from the MS-DOS prompt.progname<Enter>
A comma may be used instead of a space between 'progname' and fontfile. File extensions default to .BBC unless given explicitly.
BBCRUN progname Creates 'progname.EXE' from 'progname.BBC'. BBCRUN progname /C As above, but the program is CRUNCHed. BBCRUN progname /U As above, but the program is UNLISTed. BBCRUN progname fontfile Creates 'progname.EXE' from 'progname.BBC' and incorporates the font definition file 'fontfile'. BBCRUN progname fontfile /C As above, but the program is CRUNCHed. BBCRUN progname fontfile /U As above, but the program is UNLISTed.
BBCRUN may be replaced by BIGRUN in the above examples. If using BIGRUN you may have to add an additional /99 to limit the amount of memory used:
BIGRUN progname fontfile /C /99