TT BASICSTUDIO

… downloads

READ / COPY / TRY

Start with
an example.

Short pieces BASIC for your next idea. Copy an excerpt or download the complete source.

START

Hello Atari

The smallest step: text, a variable and a calculation.

Print "Hello Atari TT!"
Dim answer As Integer = 6 * 7
Print answer
End
Download MAIN.BAS ↓

FOUTEN

Catching errors

Catch an error from a function and move on. Throw creates its own error message. Finally is not yet supported.

' Catch errors here, or in a method called from Try.
Function Divide(a As Double, b As Double) As Double
    Return a / b
End Function

Try
    Print Divide(42, 0)
Catch message As String
    Print "Recovered: " & message
End Try

Try
    Throw "An application-defined error"
Catch message As String
    Print message
End Try
Print Divide(84, 2)
Download TRYDEMO.BAS ↓

GETALLEN

Numbers & arrays

View the included demonstration of numeric types, calculations and arrays.

Dim values(2) As Integer
values(0) = 6
values(1) = 7
Print values(0) * values(1)
Download NUMBERS.BAS ↓

GEM

A real GEM window

This small form shows a drop-down list. The full CONTROLS project also includes multiselect, a ComboBox, radio groups and MessageBox.

Dim form As New Window("Mijn eerste app", 320, 200)
Dim choices As New ListBox(form, 16, 16, 200, 100)
choices.AddItem("Atari TT")
choices.AddItem("GEM")
form.Show()
Application.Run()
Download CONTROLS.BAS ↓

MELDING

Ask a question

Use the result value to continue. Combine button and icon constants with +.

Dim answer As Integer
answer = MessageBox.Show("Doorgaan?", MessageBox.YesNo + MessageBox.Question, "TT BASIC")
If answer = MessageBox.Yes Then
    Print "We gaan verder"
End If
Download CONTROLS.BAS ↓

MIDI

MIDI without sound

Dry-run: This code does not send MIDI to your equipment. The output shows which messages would be sent. The full DX7 project contains more examples.

Midi.EnableOutput(False)
Midi.NoteOn(1, 60, 100)
Midi.NoteOff(1, 60)
Download DX7DEMO.BAS ↓

The entire workbench.

For examples with Imports or a .TBP project, use the full package so that all necessary files are together.

Download all examples ↗

What do you think?

Tell us what you make, ask a question or share your experience with the development environments.

The count starts with this update; previous downloads are unknown. ZIP packages and ST images count, not unique individuals.

Your name and comment will be visible on the homepage and the associated project site. No email address required. You can delete it via this browser on the site where you post the comment.

Loading comments…