by Jon Ripley, April 2007
This page is intended to contain information that is relevant to RISC OS users using BBC BASIC for Windows.
RISC OS has no default method of loading or saving BBC BASIC for Windows programs so a third party conversion tool is required.
To convert BBC BASIC programs between the Acorn and Windows tokenised formats use the Basic Converter application by Jonathan Harston. Once programs are retokenised into Acorn format or converted to text they can be edited with any RISC OS text editor.
BB4W can load Acorn tokenised format programs and no special steps are required to transfer the application back to Windows. Using the Basic Converter application is optional in this case.
When a BBC BASIC for Windows program that has been saved in Acorn format is reloaded into the BB4W editor the keywords PRIVATE and BY will not be tokenised. To ensure that the program is tokenized correctly load the program into the BB4W editor and type the following key combinations to force the editor to retokenise the program:
BBC BASIC for Windows has a built-in program cruncher and there is no need to crunch BB4W programs using RISC OS program crunchers. BB4W has a built-in cruncher and there are some fundamental differences between the RISC OS and Windows versions of BBC BASIC that prevent crunching on RISC OS being viable. Some major problems include:
On windows the serial device can be opened for input and output on the same channel, whereas on RISC OS the serial device has to be opened seperately for input and output.
REM Open serial device on Windows ser%=OPENUP"COM1: 9600,8,N,1" REM Open serial device on RISC OS serin%=OPENIN("Serial:") serout%=OPENOUT("Serial:")
If you are converting code and are tempted to use:
you must be careful not to close both serin% and serout%, as both variables point to the same channel. The following will give an error when trying to CLOSE#serout% as it is trying to close an already closed channel:
Code similar to the following should be used, also using the code to prevent multiple cascading errors on closing (see Forcing a variable to exist):
IF serin%=serout% THEN serout%=0 IF serin% THEN temp%=serin%:serin%=0:CLOSE#temp% IF serout% THEN temp%=serout%:serout%=0:CLOSE#temp%