then is optional
This commit is contained in:
+4
-4
@@ -10,7 +10,7 @@ Luxferre's Truly Tiny BASIC (henceforth LTTB) is a lean dialect of the BASIC pro
|
|||||||
* A special pseudo-variable `$` holding a random number from 0 to 9999
|
* A special pseudo-variable `$` holding a random number from 0 to 9999
|
||||||
* Line numbering from 1 to 32767
|
* Line numbering from 1 to 32767
|
||||||
* Unbounded subroutine call stack
|
* Unbounded subroutine call stack
|
||||||
* Supported commands: `LET`, `IF ... THEN`, `INPUT`, `PRINT`, `GOTO`, `GOSUB`, `RETURN`, `END`, `LIST`, `CLEAR` (synonym `NEW`), `RUN`, `LOAD`, `SAVE`, `BYE`
|
* Supported commands: `LET`, `IF ... (THEN)`, `INPUT`, `PRINT`, `GOTO`, `GOSUB`, `RETURN`, `END`, `LIST`, `CLEAR` (synonym `NEW`), `RUN`, `LOAD`, `SAVE`, `BYE`
|
||||||
* Any invalid command is ignored, so it still is possible to use e.g. `REM` for comments
|
* Any invalid command is ignored, so it still is possible to use e.g. `REM` for comments
|
||||||
* Allowed operations within expressions: `+`, `-`, `*`, `/`, parentheses `()`
|
* Allowed operations within expressions: `+`, `-`, `*`, `/`, parentheses `()`
|
||||||
* Allowed relational operators with `IF` statements: `=`, `<>` (synonym `><`), `>`, `>=`, `<`, `<=`
|
* Allowed relational operators with `IF` statements: `=`, `<>` (synonym `><`), `>`, `>=`, `<`, `<=`
|
||||||
@@ -51,11 +51,11 @@ The following commands are the core of LTTB.
|
|||||||
|
|
||||||
Evaluates the expression `[expr]` and assigns the result to the variable `[var]`. `LET` is the only core command keyword that can be omitted in LTTB, because `[var]=` is enough to detect the assignment statement.
|
Evaluates the expression `[expr]` and assigns the result to the variable `[var]`. `LET` is the only core command keyword that can be omitted in LTTB, because `[var]=` is enough to detect the assignment statement.
|
||||||
|
|
||||||
Examples: `let x=10`, `y = RND(1000)+8`
|
Examples: `let x=10`, `y = $ + 8`
|
||||||
|
|
||||||
### `IF [expr1] [relop] [expr2] THEN [stmt]`
|
### `IF [expr1] [relop] [expr2] (THEN) [stmt]`
|
||||||
|
|
||||||
Execute a statement `[stmt]` if the relation denoted by `relop` holds between `[expr1]` and `[expr2]`. Unlike most other TB implementations, `THEN` is mandatory in LTTB.
|
Execute a statement `[stmt]` if the relation denoted by `relop` holds between `[expr1]` and `[expr2]`. Using `THEN` is optional but recommended.
|
||||||
|
|
||||||
Examples: `IF A > B THEN LET C = A-B`, `IF X<1000 THEN GOTO 400`
|
Examples: `IF A > B THEN LET C = A-B`, `IF X<1000 THEN GOTO 400`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user