R. T. RUSSELL
BBC BASIC for Android, iOS and in-Browser
Guide to using the Touch IDE
The BBC BASIC 'touch IDE' (used for the Android, iOS and in-browser editions of BBC BASIC) has two main interfaces:
the file selector and the program editor; when you run BBC BASIC
you are initially presented with the file selector.
Both should respond 'conventionally' to the common touch gestures: tap, long press (touch-and-hold), drag and pinch; details are given below. Pressing the [back] button will usually return you to what you were doing previously (in iOS the [back] button is overlaid in the top-left corner).
If you have a keyboard available (e.g. a BlueTooth keyboard in the case of Android and iOS, or the main keyboard in the case of the in-browser
edition running on a desktop platform) you can also control the 'touch IDE' that way. The Escape key has the same effect as the back button.
The file selector displays a list of directories and files. The various touch gestures behave as follows:
- A short tap on a program name runs that program. A tap on a directory name moves into that directory.
When using a keyboard, Enter has this effect; the up and down arrow keys move the current selection.
- A long press on an item, or on the blank space below the list of files, opens a context menu
containing relevant options according to where you pressed.
When using a keyboard, the Tab key has this effect.
- A vertical drag or flick scrolls the list of directories and files. On a desktop platform, the mouse
wheel has the same effect.
- A pinch changes the size of the font. The new size will be remembered in subsequent sessions. When using
a keyboard, F2 and Shift+F2 have this effect.
The list always contains the following items: .. to signify the parent directory ('up'), @lib$
to signify the library directory and @usr$ to signify the user's personal directory. To return to the
initial screen you can tap on @lib$ then .. then examples.
In Android you can navigate to other useful places (for example Download) by starting at @usr$ and
then tapping .. ('up') repeatedly until you get to a list containing the folder you want. In iOS the @usr$ directory is
shared and can be seen from a connected PC or Mac using iTunes, or from the Files app.
The contents of the Context Menu depend on where you long-pressed (or used the Tab key). If you pressed on a file, the menu
will contain the following items:
- Open: Run the program (same as tapping on it).
- Edit: Open the editor and display the program for viewing or editing.
- Delete: Delete the file (you will be prompted for confirmation).
- Rename: Rename the file.
- Copy: Copy the file or directory in preparation for a subsequent 'paste'.
- Cut: Cut the file or directory in preparation for a subsequent 'paste'.
If you pressed in the empty space below the list of files, the Context Menu will contain the following items:
- New file: Create a new file in this directory (you will be prompted for the name).
- New folder: Create a new sub-directory (you will be prompted for the name).
- Paste file: Paste a previously 'Copied' or 'Cut' file or directory here.
- List all files: List all the files in this directory rather than only .bbc files.
- Exit: Exit from the Touch IDE to immediate mode. This is generally not useful!
The program editor displays a program for viewing or editing, with syntax colouring and auto-indentation. To exit the editor
press the [back] button (if the On Screen Keyboard is displayed press the button twice) or press the Escape key.
The various touch gestures behave as follows:
- A short tap moves the text cursor (caret) to the character nearest where you tapped, and
opens the On Screen Keyboard. The keyboard can be dismissed by pressing [back] (Android).
- If there is any selected text, tapping on the highlighted region opens a menu of options.
On a desktop platform, a mouse right-click has this effect.
- A long press opens a menu of editing commands. On a desktop platform, a mouse right-click has this effect.
- A long press and drag selects a block of code. A horizontal drag selects part of a line, a
vertical drag selects entire lines. When using a keyboard, hold down Shift and move the caret (cursor) with the arrow keys.
- A vertical drag or flick scrolls the program; a horizontal drag pans the program. On a desktop platform,
scrolling is controlled by the mouse wheel.
- A pinch changes the size of the font. The new size will be remembered in subsequent sessions. When using
a keyboard, F2 and Shift+F2 have this effect.
If entering program code into an empty editor, or at the very end of a program, remember to press Enter (Return)
after each line of code typed.
To create a new program from scratch perform the following steps:
- Navigate to a writable directory; @usr$ is a good choice.
- Long-press (or press the Tab key) below the list of files; select New File from the menu displayed.
- Enter the name of the new program (include the .bbc extension) and tap OK or press Enter.
- Long-press (or press the Tab key) on the name of the program; select Edit from the menu displayed.
- Type (or paste) the program. When complete press [back] (or press the Escape key) to return to the file list.
If you want your program to return to the Touch IDE automatically on pressing [back], as the
supplied examples do, include an ON ERROR statement at the beginning as follows:
ON ERROR CHAIN @lib$+"../examples/tools/touchide"
If you prefer you can test the error number so that other errors are reported; see any of the
example programs for how to achieve that.
It is inevitable that from time to time BBC BASIC will crash (for example abort with an untrapped error), especially if you
are testing and debugging your own programs. If this happens it will not damage your device or other apps, but it will
be necessary to close BBC BASIC and open it again. To do that proceed as follows:
- On Android tap on the the menu/app button (usually to the left of the home button); on iOS press the home button twice.
- Fully close BBC BASIC by swiping it away.
- Restart BBC BASIC from your home screen.
Home -
Products -
Contact us
© Richard Russell 2021