By default, the screen is updated every time BBC BASIC displays text or graphics. There are instances when may you wish to temporarily suspend this behaviour, for example to reduce flicker when an animation is being displayed.
*REFRESH ON | The default behaviour is to update the screen as soon as graphics or text is displayed. This can result in flickery animation. | |
*REFRESH OFF | By disabling the automatic update and explicitly calling *REFRESH, smooth animation is possible. |
- *REFRESH forces an immediate screen refresh.
- *REFRESH OFF disables the automatic refresh; the screen will only be updated as the result of a *REFRESH command.
- *REFRESH ON restores the normal behaviour.
A typical render loop for animated graphics may look like this:
10 *REFRESH OFF 20 exited=FALSE 30 REPEAT 40 ... 50 ... 60 ... 70 *REFRESH 80 UNTIL exited 90 *REFRESH ON
When an error is unhandled or otherwise reported, automatic refresh is switched back on so that the error message can be seen.
Syntax
*REFRESH [ON|OFF]