Skip to content

Commit 4ee5f27

Browse files
MrKOSMOSboriel
authored andcommitted
Create INPUT42 doc
Initial proposal based on INPUT and the INPUT42 source file
1 parent 5c25b3c commit 4ee5f27

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

docs/identifier.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ You should also avoid defining (with a SUB or FUNCTION command) routines with th
120120
* **[CSRLIN (Library Function)](library/csrlin.md)** **(function)**
121121
* [HEX (Library Function)](library/hex.md) **(function)**
122122
* [HEX16 (Library Function)](library/hex.md) **(function)**
123-
* **[INPUT (Library Function)](library/input.md)** **(function)**
123+
* **[INPUT42 (Library Function)](library/input42.md)** **(function)**
124124
* **[GetKey (Library Function)](library/keys/getkey.md)** **(function)**
125125
* **[MultiKeys (Library Function)](library/keys/multikeys.md)** **(function)**
126126
* **[GetKeyScanCode (Library Function)](library/keys/getkeyscancode.md)** **(function)**

docs/library/input42.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Input42.bas
2+
3+
## INPUT42
4+
5+
Simple INPUT routine (not as powerful as Sinclair BASIC's), but this one uses the PRINT42 routine.
6+
Issues a cursor to the screen, waits for the user to type and returns the user's input through PRINT42 when the user presses ENTER.
7+
8+
## Syntax
9+
10+
```basic
11+
A$ = INPUT42(MaxChars)
12+
```
13+
MaxChars is the number of characters the INPUT42 function will accept as a maximum. It is a UINTEGER and thus has a maximum value of 65535.
14+
15+
## Requirements
16+
17+
INPUT42 is a library function that must be included before it can be used. Use the following directive:
18+
19+
```
20+
# include <input42.bas>
21+
```
22+
23+
## Remarks
24+
25+
* Note that this function ALWAYS RETURNS A STRING, which is very different from Sinclair BASIC's INPUT statement.
26+
* This function places the Input cursor at the last print position, not at the bottom of the screen. Remember that ZX Basic allows access to all 24 screen lines, so PRINT AT 24,0; sets the PRINT cursor to the bottom of the screen.
27+
* Avoid recursive / multiple inclusion
28+
* The input subroutine DOES NOT act like ZX Spectrum INPUT command
29+
* Uses ZX SPECTRUM ROM
30+
31+
## See also
32+
33+
* [ INKEY ](../inkey.md)
34+
* [ INPUT ](../input.md)
35+
* [ PRINT42 ](print42.bas.md)

0 commit comments

Comments
 (0)