BBSML Tutorial

BBSML (BBS Markup Language) is a simplified BASIC-style language used to design your RetroBBS nodes. It is executed line by line in the browser's CRT engine.

Why BBSML?

It combines the nostalgia of 1980s BASIC programming with modern web capabilities. You write code that looks like it belongs on a Commodore 64, but it can read databases, chat with other nodes, and persist files on the cloud.

Basic Syntax

BBSML is built around line numbers, variables, and straightforward commands.

Line Numbers Every line of code must start with a number. The engine executes them sequentially.
10 PRINT "HELLO"
20 PRINT "WORLD"
Variable = value Assigns a value (number or string) to a variable name. Supports string concatenation with + or ;.
60 X = 10
70 Y$ = "SYSOP"
80 Z$ = Y$ + " ON LINE"
REM comment Adds a comment to your code. The engine ignores these lines.
110 REM THIS IS A COMMENT
END Stops execution of the script.
100 END

Input / Output

Commands to manipulate the screen and receive user input.

CLS Clears the screen and resets the cursor to (1,1).
10 CLS
COLOR fg, bg Sets the foreground (text) and background color for subsequent PRINT commands. Colors are 0-15 based on the system palette.
20 COLOR 1, 0 : PRINT "WHITE ON BLACK"
LOCATE row, col Moves the cursor to the specified row (1-30) and column (1-40).
30 LOCATE 5, 10 : PRINT "CENTERED TEXT"
PRINT "text" ; variable Outputs text or a variable's value. Use a semicolon ; at the end to suppress the newline.
40 PRINT "ENTER NAME: ";
GET variable Reads a single keystroke. Returns an empty string if no key is pressed.
110 GET K$ : IF K$ = "" THEN 110 : REM Wait for key
INPUT "Prompt", variable Halts execution and waits for the user to type a string and press ENTER. Stores the input in the specified variable.
115 INPUT "WHAT IS YOUR NAME? ", N$
SLOW / NOSLOW Toggles character-by-character printing simulation (dial-up effect).
120 SLOW : PRINT "DIAL-UP SPEED..." : NOSLOW

Logic & Loops

Control the flow of your program.

FOR var = start TO end ... NEXT var Executes a block of code repeatedly. The RetroBBS engine simulates vintage CPU cycles by artificially yielding during loops, making them visible.
10 FOR D = 1 TO 500 : NEXT D : REM 1980s-style delay
IF condition THEN command/line Conditional execution. Supports AND, OR, and implied GOTO (just the line number).
90 IF X = 10 OR Y = 5 THEN 200 : REM Implied GOTO 200
95 IF K$ = "M" AND X > 0 THEN GOSUB 3000
GOTO line Jumps execution to the specified line number.
70 GOTO 10
ON value GOTO line1, line2, ... Jumps to a line number based on the value (1 for line1, 2 for line2, etc.). Often used for menus.
100 ON X GOTO 500, 600, 700
GOSUB line / RETURN Jumps to a subroutine and returns to the next command after the call.
80 GOSUB 500 : PRINT "BACK" : END
500 PRINT "IN SUB" : RETURN
String Functions CHR$(code), ASC(string), LEN(string), LEFT$(string, n).
70 PRINT LEFT$(U$, 1) : L = LEN(U$)

Local File I/O

These commands allow you to read and write files directly in your node's storage area. This is a 100% Free CORE Feature.

FILES Lists all files stored in your private node storage area directly to the screen.
10 FILES
TYPE "filename" Reads the specified file and prints its entire contents to the screen. Ideal for banners and bulletins.
20 TYPE "welcome.txt"
READ "filename", var$ Reads the content of a file into a string variable. If the file does not exist, the variable will be empty.
30 READ "scores.txt", S$ : PRINT "CURRENT SCORES: " ; S$
WRITE "filename", content$ Writes the specified content to a file in your node storage. Overwrites existing files.
40 WRITE "log.txt", "USER LOGGED IN AT " + T$
DELETE "filename" Removes a file from your node storage area.
50 DELETE "temp.tmp"

Database Commands

PREMIUM FEATURE: The following Database commands require an active Premium (ELITE, ELITE+, or LIFE) Sysop subscription to execute on the mainframe.
DBMAKE "tablename", "field1,field2" Creates a new relational database table with the specified fields. You can also manage tables visually from the Node Database Admin page on your dashboard.
10 DBMAKE "users", "name,score"
DBINSERT "tablename", "value1,value2" Inserts a new record into the specified table. The values must match the order of the fields defined when the table was created. Do not include field names.
20 DBINSERT "users", "Tim,500"
DBGET "tablename", "search_field", "search_value", "return_field", RESULT$ Queries the database for the first record where search_field matches search_value, and stores the data from return_field into the RESULT$ variable.
30 DBGET "users", "name", "Tim", "score", S$
DBDROP "tablename" Permanently deletes the specified database table and all its data. Use with caution!
40 DBDROP "users"

Global Dropzone

PREMIUM FEATURE: The following Dropzone commands require an active Premium (ELITE, ELITE+, or LIFE) Sysop subscription to execute on the mainframe.

The Global Dropzone is a shared public folder accessible by every node on RetroBBS.

GLOBALFILES Lists all files currently stored in the global public dropzone.
10 GLOBALFILES
DROP "filename", content$ Creates a file in the global dropzone for all RetroBBS nodes to see.
20 DROP "msg.txt", "HELLO ALL BBSES!"
GET "filename", var$ Reads a file from the global dropzone into a string variable.
30 GET "msg.txt", G$

Messaging & Chat

PREMIUM FEATURE: The following Messaging commands require an active Premium (ELITE, ELITE+, or LIFE) Sysop subscription to execute on the mainframe.
WHO / WHONODE Lists users currently online. WHO shows everyone on RetroBBS, while WHONODE shows only users currently visiting your specific node.
10 WHONODE
CHAT "message" Sends a public message to everyone currently visiting your node. Ideal for local chat rooms.
20 CHAT "WELCOME TO MY NODE, EVERYONE!"
MSG "alias", "message" Sends a private message to a specific user by their Sysop Alias or Login.
30 MSG "Operator", "COULD YOU ASSIST ME WITH THIS CODE?"
POLL M$, S$, P Checks for the next unread message. M$ stores the message text, S$ stores the sender's alias, and P is 1 for private messages or 0 for node chat. If no message is waiting, M$ will be empty.
40 POLL M$, S$, P : IF M$ = "" THEN GOTO 40 : REM WAIT LOOP

Special Control Codes

Use these with the CHR$() command to manipulate the terminal.

CodeFunctionDescription
CHR$(147)CLRClears the CRT screen and resets cursor to top-left (same as CLS).
CHR$(13)CRCarriage return (moves cursor to next line).
CHR$(20)DELDeletes the character before the cursor (Backspace).
CHR$(7)BELSimulates a system beep (Sysop alert).

Color Palette (0-15)

Used with the COLOR fg, bg command.

IDColorIDColor
0Black8Orange
1White9Brown
2Red10Light Red
3Cyan11Dark Grey
4Purple12Grey
5Green13Light Green
6Blue14Light Blue
7Yellow15Light Grey

Visual Studio Tips

  • Visual Stamping: Use the GFX Studio to click or drag on the canvas and place characters visually. The engine will generate the BASIC code for you!
  • Auto-Renumbering: When you paste generated code into the Main Editor, it will preserve your line numbers to ensure GOTO/GOSUB jumps remain intact.
  • System Specific Glyphs: The Studio automatically loads the extended character set for your chosen BBS System (C64 PETSCII, Atari ATASCII, IBM CP437, Amiga ASCII).
  • Live Preview: Use the iframe on the left pane to instantly test your BBS node without opening a new tab.