Skip to content

Commit 71bd753

Browse files
committed
UPDATE README
1 parent 7510f64 commit 71bd753

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,30 @@ Run this once after unpacking, and macOS will stop treating the binary as “fro
8585

8686
- **`SLEEP`**: pause execution for a number of 60 Hz “ticks” (e.g., `SLEEP 60` ≈ 1 second).
8787

88+
### Tokenised PETSCII shortcuts inside strings
89+
90+
- **Inline `{TOKENS}`**:
91+
- Within double-quoted strings, the interpreter recognises `{...}` patterns and expands them to `CHR$()` calls **at load time**.
92+
- This lets you write readable code such as:
93+
94+
```basic
95+
PRINT "HELLO {RED}WORLD{WHITE}"
96+
PRINT "{CLR}READY."
97+
PRINT "MOVE {DOWN}{DOWN}{RIGHT} HERE"
98+
```
99+
100+
- **What it does**:
101+
- Each `{TOKEN}` inside a string is replaced as if you had written `";CHR$(N);"` at that point in the source, so all existing PETSCII/ANSI mappings for `CHR$` apply unchanged.
102+
- Tokens can be:
103+
- **Numeric**: e.g. `{147}``CHR$(147)`.
104+
- **Named** PETSCII codes from the built-in table, including:
105+
- Colors: `WHITE`, `RED`, `CYAN`, `PURPLE`, `GREEN`, `BLUE`, `YELLOW`, `ORANGE`, `BROWN`, `PINK`, `GRAY1`/`GREY1`, `GRAY2`/`GREY2`, `GRAY3`/`GREY3`, `LIGHTGREEN`/`LIGHT GREEN`, `LIGHTBLUE`/`LIGHT BLUE`, `BLACK`.
106+
- Screen/control keys: `HOME`, `DOWN`, `UP`, `LEFT`, `RIGHT`, `DEL`/`DELETE`, `INS`/`INSERT`, `CLR`/`CLEAR`.
107+
- Reverse video: `RVS`, `REVERSE ON`, `RVS OFF`, `REVERSE OFF`.
108+
- **Behaviour notes**:
109+
- Token expansion is **purely a source transform**; once loaded, the program runs exactly as if you had typed the equivalent `CHR$()` expressions yourself.
110+
- Tokens are only recognised **inside quoted strings**; everything else in your BASIC code is left untouched.
111+
88112
### Screen coordinates and cursor positioning
89113

90114
- **Coordinate system**:

0 commit comments

Comments
 (0)