Language and compatibility
Understand the Cortex BASIC compatibility target, optional line numbers, labels, core language families, and explicit DOS limitations.
Cortex BASIC reference · language features and browser requirements.
One Cortex language
Web and native Cortex share a language contract. Cortex supports broad QBASIC / QuickBASIC-style source compatibility with explicit browser adaptations for modern capabilities. Programs execute locally in the shared interpreter; the compatibility limits below still apply.
Source can use line numbers or labels
Line numbers are optional. Preserve them when importing legacy programs because they can be branch targets. Labels are also first-class targets and can coexist with line numbers. The Terminal does not store numbered lines for program editing; editing belongs in the Editor.
The compatibility target
- Numeric and string types, suffix typing, defaults, expressions, strings and math.
- IF/THEN/ELSE, SELECT CASE, FOR/NEXT, WHILE/WEND, DO/LOOP, GOTO and GOSUB/RETURN.
- DIM/REDIM arrays, TYPE records, DATA/READ/RESTORE, SUB/FUNCTION/DECLARE and DEF FN.
- PRINT, PRINT USING, INPUT, LINE INPUT, file I/O and error handling.
- Classic graphics, sound/music, keyboard input and timing.
The shared language core evaluates scalar expressions, control flow, arrays, DATA/READ/RESTORE, procedures, functions and TYPE records. Terminal now runs these locally with PRINT/PRINT USING, INPUT/LINE INPUT and text screen controls. Editor Run uses the same interpreter. The compatibility corpus checks these families. GORILLA.BAS is one benchmark, not the definition of compatibility.
Available now: local editor syntax colors
The Web Editor now uses a BASIC lexer for keyword, string, number, comment, label, source-line-number and type-suffix colors. Its native keyword catalog also recognizes Cortex family names such as SCAN, GPS and UI. Analysis runs in a background worker on your device; code is not uploaded.
A missing closing quote, missing exponent digits or unexpected character produces a lexical error count and the first error’s line and column. Use Go to lexical error to select the problem. A clean lexical check does not certify the program: Run parses and executes the current draft, with output and INPUT in Terminal and error links back to the file and line. Find/replace, undo/redo, go-to-line/label, indentation, completion suggestions and optional source numbers are available in the Editor toolbar. Classic graphics, sound and game keys are available; modern media, networking, SQLite and device APIs use the same runtime. Large highlight sets or an unavailable worker fall back to plain text without preventing edits.
What native 1.0 does not promise
Raw PEEK/POKE access to PC memory, direct ports, BIOS interrupts, assembly, machine code, DOS SHELL dependencies, and executable chaining are outside the native 1.0 scope unless safely emulated later. Unsupported behavior must be reported instead of silently ignored.
Start with the foundations
Read your first BASIC program for PRINT and comments, then variables, loops, and INPUT. Run the examples in Terminal or Editor to check their syntax and behavior.