This is an old revision of the document!
Table of Contents
SmileBASIC API Reference
This page is a series of notes gathered while reading the official SmileBASIC documentation and their Instruction List. It's not as clear to read as other code documentation sites out there, so my intent is to consolidate it to something easy to browse and reference.
Function names will be listed alphabetically. Feature-related lists of links will be provided as a convenience.
NOTE In case it's not obvious, this is a work in progress. NOTE
Names and Variables
SmileBASIC supports variable names that are alphanumeric, with optional underscores. Anything that matches this regex should do: [a-zA-Z0-9_]+
System Variables
Types
When defining a variable, you encode its type along with its name.
Strings
Strings are defined via the $
sigil:
A$ = "HELLO WORLD" PRINT A$ ' outputs 'HELLO WORLD'
Numbers
Numbers can be integers, or floating point numbers. Variables are integers by default.
B# = 4 PRINT B# ' outputs '4'
Operators
Logic and Control Flow
Input
Graphics Layering
Sound Effects and Music
DIRECT Mode Commands
Function Reference
This section is where all the "proper" content lives. Other parts of the page should link back here where relevant.
PRINT [expression[; expression || : expression …]]
Output the given expression
to the screen. Using a semicolon (;
) as delimiter concatenates expressions without spaces between them, while the comma (,
) adds TABSTEP spaces.
Using a question mark before an expression is a shorthand for calling PRINT:
?(7 + 2) ' outputs 9