BBC BASIC for TI-OS Programmers

Introduction

This section aims to help programmers familiar with the programming language built-in to the TI-83+ and TI-84+ operating system by discussing its features and the BBC BASIC equivalents.

Input and Output

Input

BBC BASIC's INPUT statement is very similar than the TI-OS Input statement.

Prompt

There is no direct equivalent for the TI-OS Prompt statement. You can use INPUT as a substitute - for example,

INPUT "X=?"X

performs the same task as the TI-OS command Prompt X.

Disp

The standard BASIC PRINT statement performs the same task as the TI-OS statement Disp.

DispGraph, DispTable

As BBC BASIC only has a single screen that mixes text and graphics there are no equivalent statement to the TI-OS DispGraph or DispTable.

Output(

The TAB statement can be used to set the cursor position as part of a PRINT statement.

getKey

There is no direct BBC BASIC equivalent to this function, but there are a number of alternatives.

INKEY(0) is the closest equivalent to the TI-OS getKey function, but it does not return a value if a non-alphanumeric key (such as the cursor keys or modifiers) is pressed. To check the state of the non-alphanumeric keys you will need to use INKEY(n) where n is the key's code and n<0.

ClrHome

CLS is BBC BASIC's equivalent to the TI-OS ClrHome statement. It will clear the text viewport to the current text background colour (set with COLOUR).

ClrTable

BBC BASIC does not display table of results, so there is no equivalent statement.

GetCalc(, Get( and Send(

These features are not currently implemented.

Drawing Operations

ClrDraw

BBC BASIC's equivalent statement to ClrDraw is CLG, which will clear the graphics viewport to the current graphics background colour (set with GCOL).

Line(

To draw a line you first need to MOVE the graphics cursor to the start of the line then DRAW to the end of it. This will draw a line in the current foreground colour. For more advanced line-drawing operations (including support for dotted and dashed lines) you will need to use the PLOT statement.

Horizontal and Vertical

BBC BASIC does not have any equivalent drawing operation to the Horizontal and Vertical statements. You can get the same effect by drawing a line with either both Y coordinates or both X coordinates set to the same value.

Tangent(, DrawF, Shade( and DrawInv

BBC BASIC does not graph functions, so there are no equivalents to the Tangent(, DrawF, Shade( and DrawInv statements.

Circle(

Outlined or filled circles or ellipses can be drawn using the PLOT modes 144-151, 152-159, 192-199 or 200-207.

The following example code defines a procedure that draws a circle outline in the current background colour given an origin and a radius.

DEF PROC_circle(x,y,r)
MOVE x,y
PLOT 145,0,r
ENDPROC

Text(

You can draw text anywhere on the screen using the VDU 5 mode, then use the PRINT statement as normal. The following example code defines a procedure that acts in a similar method to the TI-OS Text( statement.

DEF PROC_text(y,x,text$)
VDU 5
MOVE x,y
PRINT text$
VDU 4
ENDPROC

Note the reversed x and y parameters.

Pt-On(, Pt-Off(, Pxl-On( and Pxl-Off(

PLOT modes 64-71 can be used to set the colour of individual pixels.

Pt-Change( and Pxl-Change(

You can use the PLOT modes 64-71 along with an inverting plot mode to toggle the state of pixels. The following code example defines a procedure that acts in a similar way to the TI-OS Pxl-Change( statement.

DEF PROC_pxlChange(y,x)
PLOT 70,x,y
ENDPROC

Not the reversed x and y parameters.

pxl-Test(

BBC BASIC's POINT function is equivalent to the TI-OS pxl-Test(. Like the other pxl- functions the order of x and y parameters is reversed.