Cheat Sheet for Experienced Programmers

TMBASIC is a statically- and nominally-typed BASIC language. Roughly speaking, it is a cross between QBASIC and Visual Basic (pre-.NET).
┌─ Supported features ─────────────────────────────────────────────────┐
│  √ Statically typed (vs. dynamic)        √ if, for, for each, while  │
│  √ Nominal type system (vs. structural)  √ print, input              │
│  √ Exception-based error handling        √ Text-based UI library     │
┌─ Unsupported QBASIC features ─┐ ┌─ Unsupported VB features ────────┐ │ No line numbers │ │ No object oriented programming │ │ No "goto" │ │ No multithreading │ │ No "peek" or "poke" │ │ No graphics or sound support │ │ No type suffixes, like $ │ │ No interop with C/C++ │ └───────────────────────────────┘ └──────────────────────────────────┘
TMBASIC has a visual designer for text user interface (TUI) forms and controls, enabling rapid application development. Forms and controls may also be constructed dynamically in BASIC code as needed. Simpler apps may use simple print / input calls instead of a full TUI.

Data types

There are no object or reference semantics in TMBASIC, and thus no real support for object oriented programming (OOP). Everything is a value. Assigning to a variable always makes a copy, even for records, lists, and maps. Procedure parameters are passed by value. Internally, TMBASIC uses immutable data structures to make this efficient.

Sample code

if ... then ... else ... end if

sub FizzBuzz(n as Number)
dim fizz = (n mod 3) = 0
dim buzz = (n mod 5) = 0
if fizz and buzz then
print "FizzBuzz"
else if fizz then
print "Fizz"
else if buzz then
print "Buzz"
print n
end if
end function
sub Main()
dim n as Number
print "Enter a number, or 0 to quit: ";
input n
if n <> 0 then FizzBuzz n
end sub

Build a list efficiently with select

function Fibonacci(count as Number) as List of Number
' No explicit type needed when providing an initial value.
dim a = 0
dim b = 1
' Use "select" to build the list to be returned.
select a
select b
for i = 3 to count
dim c = a + b
select c
a = b
b = c
end function
sub Main()
for each n in Fibonacci(50)
print n
end sub