The guide, in human order¶
This page is the map of the whole d/BASIC guide. It is arranged as a course you can read from the top or dip into anywhere, not an alphabetical wall of keywords. By the end of it you will know which chapter answers which question, and every code block in every chapter opens in the playground with one click.
Foundations¶
1 · Make something runThe playground, the command line, your first program, and the difference between a console program and a window program.
2 · Choose a program shapeA program you talk to in the console, a script that runs on its own, a program with windows and events, or a mix.
3 · Learn the nounsNames, literals, variables, types, declarations, and the classic suffixes like
$ and %.
4 · Own the storageWhat DIM sets aside, where a variable is visible, how long it lives, arrays, objects, and letting go on purpose.
5 · Work with textJoining, slicing, searching, converting, fixed-width fields, raw bytes, and where UTF-8 characters begin and end.
6 · Calculate meaningOperators, which ones go first, calling functions, comparing, logic, and the built-in functions.
7 · Give it a plotBranches, loops, SELECT CASE, named labels, and code with line numbers.
8 · Give ideas namesSUBs, FUNCTIONs, what a procedure can see, and when to pass a variable itself (BYREF) or a copy (BYVAL).
9 · Work in collectionsBounds, resizing, passing arrays to procedures, copying, filling, and swapping two arrays without copying anything.
10 · Model a worldRecords that copy by value first; then objects, their lifetime, properties, and virtual methods.
11 · Talk to the consolePRINT, INPUT, formatting, DATA built into the program, random numbers, and time.
12 · Handle trouble honestlyError messages, ERR and ERL, catching a request the machine cannot carry out, recovering, and cleaning up.
Applications and the outside world¶
13 · Work with filesMounted folders, directories, reading and writing within limits, copy, move, rename, trash, and replacing a file safely.
14 · Store durable meaningDatabase sessions, snapshots, writes, attachments, stored files, revisions, and the record each write leaves behind.
15 · Open a windowWhat happens when a window opens, draws and closes, input events, drawing, resizing, and asking for a repaint.
16 · Build an interfaceThe d/Works controls, focus, events inside a control, menus, and telling the window exactly what to repaint.
17 · Give it sights and soundsAssets packed with your program, images, fonts, tones, raw audio, and an honest account of what each machine does with them.
18 · Make a little worldGX, the 2D game library: scenes, entities, tilemaps, cameras, collision, animation, and game turns that run the same everywhere.
19 · Reach beyond the machineHTTP, streams, what a program is allowed to reach, reads and writes that arrive in pieces, security, and being honest when offline.
20 · Ask the worldIntents: named requests such as "fill this rectangle" that the machine carries out however it can, and why the language is built that way.
21 · Move real objectsDrag and drop that carries real data, DOBJ (the typed object one program hands another), agreeing on a format across programs, the Trash, and the bridge to the host's own drag and drop.
Reuse, migration, and delivery¶
22 · Share good codeLibraries built into your program, shared libraries, and libraries kept with the project, each dependency named exactly.
23 · Think like the compilerWhat the optimizer does, what things cost, why the same source always gives the same result, error messages, and how d/BASIC is tested.
24 · Outgrow 64 KiBA 512 KiB first target, memory banking you never see, values that page in and out, and intents that speed things up.
25 · Ship the artifactCompiled program files, libraries, packages, the checks a program passes before it runs, and running the same file on different systems.
26 · Bring a listing forwardWhat classic BASIC rules are kept, how to modernize a listing step by step, the machine tricks that will never run, and how the compiler tells you.
27 · Find the spellingTables of statements, built-in functions, events, operators, storage, and types.
The five ideas worth remembering¶
- Line numbers are welcome, not required. Named labels and structured blocks live in the same source file.
- A numeric name without a type is
SINGLE. Use a suffix,AS, orDEFINT A-Zwhen you mean an integer. - Parameters are
BYREFby default. WriteBYVALwhen the procedure you call should get a copy it cannot use to change your variable. TYPEcopies;CLASSshares. Two records are two values; two variables holding one object point at the same thing. This one distinction explains most record and object behavior.- Programs say what they want; each machine supplies it however it can. That is how one program crosses very different machines.
Ready? Run your first program →