Writing Your First Script
CrossBasic scripts (.xs files) are plain text. Here are key points:
- Line comments use
// - Block comments are not supported; use multiple
// - Statements end at line breaks (no
:separators required) -
Basic I/O:
-
Print(...)writes to the console Input(prompt As String)reads a line from STDIN
Example: Echo Script¶
Compile & run:
Running & Compiling Code¶
CrossBasic provides a simple CLI—crossbasicc—for compiling and running scripts.
Common Commands¶
| Command | Description |
|---|---|
crossbasicc file.xs | Compile to bytecode + VM stub (default) |
crossbasicc file.xs -o app | Compile and name output app |
crossbasicc file.xs -run | Compile and immediately run the script |
crossbasicc --debug file.xs | Include debug symbols for VM stepping |
crossbasicc --help | Show all available flags and usage |