BASIC Commands
Spectranext extends ZX BASIC with filesystem, stream, socket, and configuration commands. Most commands use a % prefix. Some filesystem commands also have a . form for shell-like direct path usage.
Use % commands when you want normal BASIC expressions:
10 LET A$="games"
20 %cd A$
Use . commands when you want to type a literal path directly:
.cd games
.cat /sys/bin
Quick Start
Open the built-in resource index:
!
Mount a filesystem automatically into a free slot and switch to it:
%mount "https://spectranext.net/demo/hn"
Mount into a specific slot and select it:
%mount 0, "xfs://ram/"
%fs 0
Load the default boot.zx program from the current filesystem:
%load ""
!
Open the Spectranext resource index.
!
This is the same resource browser that is available from the launcher. It is intended for browsing published resources and demos.
%mount
Mount a filesystem.
%mount "url"
%mount slot, "url"
The one-argument form chooses a free mount slot and then switches the current filesystem to that slot.
The two-argument form mounts into the slot you specify. Use %fs afterwards if you also want to make it current.
10 %mount "https://spectranext.net/demo/hn"
20 %load ""
10 %mount 3, "tnfs://example.com/public"
20 %fs 3
30 %cat
Common URL forms include:
xfs://ram/for the local RAM/flash overlay filesystemtnfs://host/pathfor TNFShttps://host/path/for a read-only HTTP(S) directory
.mount
Alias for %mount.
.mount "url"
.mount slot, "url"
This command still uses the normal BASIC expression parser because its syntax includes a URL string and optionally a numeric mount slot.
%umount
Unmount a filesystem slot.
%umount slot
Example:
%umount 3
Unmounting closes the selected mount point. Do not unmount a filesystem while programs are still using open streams or files from it.
.umount
Alias for %umount.
.umount slot
This command still uses the normal BASIC numeric parser.
%fs
Select the current mounted filesystem.
%fs slot
Example:
%fs 0
Filesystem commands such as %cat, %cd, %load, and %save operate on the currently selected mount point.
.fs
Alias for %fs.
.fs slot
This command still uses the normal BASIC numeric parser.
%cd
Print or change the current directory.
%cd
%cd "path"
%cd path$
With no argument, %cd prints the current working directory. With an argument, it expects a BASIC string expression.
10 LET D$="/games"
20 %cd D$
30 %cat
.cd
Print or change the current directory using a direct literal path.
.cd
.cd path
Example:
.cd /games
Use .cd for interactive use. Use %cd from BASIC programs when the path comes from a variable or expression.
%cat
List a directory.
%cat
%cat "path"
%cat path$
With no argument, %cat lists the current directory. With an argument, it expects a BASIC string expression.
10 %cat "/sys/bin"
.cat
List a directory using a direct literal path.
.cat
.cat path
Example:
.cat /sys/bin
%load
Load a ZX-format file from the current filesystem.
%load "filename"
%load ""
%load "filename" CODE
This follows the normal ZX BASIC LOAD shape, but loads from the selected filesystem instead of tape. An empty filename loads boot.zx.
%load ""
%load "game.zx"
CODE loads a CODE file at the address stored in the file header.
.load
Alias for %load.
.load "filename"
.load ""
.load "filename" CODE
This command still uses the normal BASIC loader syntax.