Skip to content
Merged

Docs #1084

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/acs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PRINT "Arc Cosine value of a is "; ACS(a)
* This function is 100% Sinclair BASIC Compatible
* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it.

##See also
## See also

* [SIN](sin.md) and [ASN](asn.md)
* [TAN](tan.md) and [ATN](atn.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/asn.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ PRINT "Arc Sine value of a is "; ASN(a)

## Remarks

* This function is 100% Sinclair BASIC Compatible
* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it.
* This function is 100% Sinclair BASIC Compatible
* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it.

## See also

Expand Down
27 changes: 27 additions & 0 deletions docs/bin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# BIN

## Syntax

```
BIN <binary numbeŕ>
```


## Description

`BIN` is used to denote a binary number. It exists mostly for compatibility reasons with Sinclair BASIC.
You can denote a binary number by prefixing it with `BIN`, but also using the `%` prefix or the `b` suffix.

For example, the number `5` can be denoted as follows:

* `BIN 101`
* `101b`
* `%101`

These three expressions are equivalent.


## Remarks

* This keyword is 100% Sinclair BASIC Compatible
* Binary numbers are always considered unsigned integers and the type depends on the size of the number.
2 changes: 2 additions & 0 deletions docs/identifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Identifiers shown in bold are taken from the Sinclair BASIC (beware their meanin
* **[AT](at.md)**
* **[ATN](atn.md)** **(function)**
* **[bAND](bitwiselogic.md#bAND)** **(operator)**
* **[BIN](bin.md)**
* **[bNOT](bitwiselogic.md#bNOT)** **(operator)**
* **[bOR](bitwiselogic.md#bOR)** **(operator)**
* **[bXOR](bitwiselogic.md#bXOR)** **(operator)**
Expand Down Expand Up @@ -100,6 +101,7 @@ Identifiers shown in bold are taken from the Sinclair BASIC (beware their meanin
* **[STOP](stop.md)**
* **[STR](str.md)** **(function)** (Can also be written as **STR$**)
* **[SUB](sub.md)**
* **[TAB](tab.md)**
* **[TAN](tan.md)** **(function)**
* **[THEN](if.md)**
* **[TO](to.md)**
Expand Down
4 changes: 3 additions & 1 deletion docs/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ PRINT "Variable 'a' contains the value: "; a
```

## Changing the print position
You can change the current _cursor_ position using the [AT](at.md) modifier:
You can change the current _cursor_ position using the [AT](at.md) or [TAB](tab.md) modifiers:

```
PRINT AT 5, 0; "This message starts at ROW 5"
PRINT AT 10, 10; "This message starts at ROW 10, COLUMN 10"
PRINT TAB 5; "This starts at column 5"
```

Again, you can chain all `PRINT` _items_ using semicolon:
Expand Down Expand Up @@ -115,6 +116,7 @@ NEXT i

* [CLS](cls.md)
* [AT](at.md)
* [TAB](tab.md)
* [PAPER](paper.md)
* [BORDER](border.md)
* [INVERSE](inverse.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packaging==24.2
paginate==0.5.7
pathspec==0.12.1
platformdirs==4.3.6
Pygments==2.20.0
Pygments==2.18.0
pymdown-extensions==10.16.1
python-dateutil==2.9.0.post0
PyYAML==6.0.2
Expand Down
28 changes: 28 additions & 0 deletions docs/tab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# TAB

## Syntax
```
PRINT TAB <value>;
```

`TAB` is not a statement, but a [PRINT](print.md) modifier. It is used to move the cursor to a specific column.
The ZX Spectrum screen has 32 columns, numbered from 0 to 31.

When `TAB` is used, the cursor moves to the specified column. If the current position is already past the requested column, the cursor moves to that column on the next line.


```
PRINT TAB 10; "Hello"
```

The above example will print "Hello" starting at column 10 of the current row.

## Remarks
* This modifier is Sinclair BASIC compatible.
* If the value is 32 or more, it is taken modulo 32.

## See also
* [PRINT](print.md)
* [AT](at.md)
* [POS](library/pos.md)
* [CSRLIN](library/csrlin.md)