related topics
{math, number, function}
{system, computer, user}
{film, series, show}
{work, book, publish}
{line, north, south}
{car, race, vehicle}

True BASIC is a variant of the BASIC programming language descended from Dartmouth BASIC — the original BASIC — invented by college professors John G. Kemeny and Thomas E. Kurtz.

When True BASIC appeared on the market in 1985, initially based on Dartmouth BASIC 7 — otherwise known as ANSI BASIC — it implemented a number of new features over QBasic, and allowed the user a redefinable 16-color, 640×480 pixel backdrop for program editing. True BASIC introduced new functions for graphics primitives like plot, plot area, flood, etc. It also was the first to provide a method for saving a portion of the screen and blitting it elsewhere, but had no proper buffering implementation.

Being a structured programming implementation of the language, it dispensed with the need for line numbers and GOTO statements, although these earlier features can still be used. Use of LET for value assignment became optional. It also allowed for descriptive variable names longer than a single letter plus a single digit. For example, the familiar algebraic equation y = mx + b (y = mx + c for the UK) could be expressed as:

let slope = 2
let x = 3
let y_intercept = 4
let y2 = slope * x + y_intercept
print "y2="; y2

The above code segment would yield "y2= 10".

True BASIC provides statements for matrix arithmetic, a feature that had been dropped in microcomputer versions of BASIC interpreters due to memory limitations. It also supports global and local variables, which permits recursive functions and subroutines to be written.

There are versions of the True BASIC compiler for DOS, Windows, and Classic Mac OS. There is currently no Mac OS X version of True BASIC, and so it will not run on Intel-based Macintoshes, nor any Macintosh running Mac OS X 10.5 Leopard. At one time, versions for Tandy, Amiga and Atari computers were offered, as well as a UNIX command-line compiler.

The designers wanted to make the language hardware-independent, to allow True BASIC source code to run equally well on any version of their compiler. For the most part they succeed in this endeavor. The drawback for users was that direct access to some features of their machines was not available, but this could be remedied with callable functions and subroutines specially written in assembly language.

Using newer versions of True BASIC, some of the older functions are blocked out. An example of the recent code would be more like this:

SET WINDOW 0,20,0,20
SET COLOR 5 !Set the pen and text colour to 5 as true basic has 0-15 colours
PRINT "Welcome To ..." !Print "Welcome To ..." on the user's screen.

DO !Begin the loop LET x=rnd*20 !Let the value 'x' equal a random number between '0' and '20' LET y=rnd*20 !Let the value 'y' equal a random number between '0' and '20' Pause .1 !Waits 1/10 of a second PLOT TEXT, at x, y: "Fabulous Wikipedia!" !Plot 'Fabulous Wikipedia!' at coordinates 'x' and 'y' LOOP !End the loop

END !End the program

As one can see, even without comments (text following the unquoted exclamation point), True BASIC code can be read rather easily. This simple program plots the text "Welcome To ..." at the top left-hand corner of the screen, and then continues into a never-ending loop plotting "Fabulous Wikipedia!" at random coordinates.

An example of simple animation could be like this:

Further reading

  • Kemeny, John G.; Kurtz, Thomas E. (1985). Back To BASIC: The History, Corruption, and Future of the Language. Addison-Wesley. 141 pp. ISBN 0-201-13433-0.

External links

Full article ▸

related documents
Computer algebra system
Curl (programming language)
Code coverage
Initialization vector
World file
Serial number
ActiveX Data Objects
Java Naming and Directory Interface
Thread safety
Bourne shell
Wikipedia:Free On-line Dictionary of Computing/I - K
Literate programming
Command-line interpreter
Flyweight pattern
Document Object Model
CDR coding
Information hiding
8.3 filename
Client-side scripting
RenderMan Interface Specification