Index


RISC World

BBC Basic

Martin Carradus introduces his latest programming tools.

!BBCIndent

!BBCIndent is designed to indent BBC BASIC programs to make it easier to follow any nested routines and procedures. It also makes it easier to see and follow CASE and IF THEN statements over multiple lines, for example, here is an original piece of code.

DEFPROCpoll
SYS"Wimp_Poll",,b% TO r%:CASE r% OF
WHEN 1: PROCredraw
WHEN 2: SYS "Wimp_OpenWindow",,b%
WHEN 3: SYS "Wimp_CloseWindow",,b%
WHEN 6: PROCmouseclick
WHEN 7: PROCenddrag
WHEN 9: PROCmenuclick
WHEN 8: PROCkeypress
WHEN 17,18 :PROCreceive
WHEN 19: PROCnoack(b%)
ENDCASE:ENDPROC

And here is the same after BBCIndent has processed it.

  DEFPROCpoll
  SYS"Wimp_Poll",,b% TO r%:CASE r% OF
       WHEN 1: PROCredraw
       WHEN 2: SYS "Wimp_OpenWindow",,b%
       WHEN 3: SYS "Wimp_CloseWindow",,b%
       WHEN 6: PROCmouseclick
       WHEN 7: PROCenddrag
       WHEN 9: PROCmenuclick
       WHEN 8: PROCkeypress
       WHEN 17,18 :PROCreceive
       WHEN 19: PROCnoack(b%)
  ENDCASE:ENDPROC

To load !BBCIndent double click on the !BBCIndent icon, an icon then appears on the icon bar, then drag a BBC Basic file to the bar icon, or left click on the bar icon and drag the BBC Basic file to the 'SetUp' panel that appears. This enters the file name into the upper slot on the panel. Alternatively the file name may be typed manually into this slot.

Select the appropriate options on the 'SetUp' panel, then click on the 'Run' icon on this panel. After a while a Indented BBC Basic file is offered for saving in the same directory as the BBC Basic, but with its name prefixed with a capital "I".


!BBCIndent and !BBCText in action

Selecting the 'Help' or 'Description' buttons on the 'SetUp' panel and clicking on the 'Run' button gives out extra information.

Additional Help is available by clicking the middle 'Menu' button over the bar icon and clicking over the 'Help' entry on the menu that appears, or by using the Acorn !Help application in the 'Apps' directory on the icon bar.

!BBCText

There is also an associated program called !BBCText, this converts tokenised BBC BASIC into normal text. If you have ever loaded raw BBC BASIC into a a text editor you may notice that it is full of control characters, instead of BASIC keywords. BBCText will convert each real BASIC token back into English. BBCText works in a similar way to !BBCIndent, you drag a file into the Window, then click on the Run button, then drag the new file out from the save dialogue box.

Martin Carradus

 Index