English
Language : 

NSB8 Datasheet, PDF (51/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
INPUT
STATEMENT:
INPUT <list of variables>
INPUT <string constant>, <var. list>
INPUT #<device expression>, <var. list>
INPUT #<device expression>, <string const.>, <var. list>
ACTION:
User input of string or numeric constant data is requested and accepted from the terminal named by
the device expression. If there is no device expression, the console, device #0, is assumed. The
device expression must be a numeric expression which evaluates to an integer from 0 to 7. The data
provided by the user is assigned to the variables named in the INPUT statement’s variable list. If no
string constant is specified, input is prompted by a question mark (sent to the terminal before input
data is accepted). If a string constant is given, however, this string is sent to the terminal as prompt,
instead. The user strikes the <CR> key when finished providing data input.
EXAMPLES:
10 INPUT A,B,Q$
70 INPUT “YOUR NAME: “,N$
35 INPUT #3,X,Y
30 INPUT #X,”COMMAND: “,C$(5,9)
19 INPUT “”,X \ REM No prompt is given at all.
REMARKS:
INPUT may not be used in direct mode.
INPUT will wait forever for user response, until the <CR> key is struck.
String constants entered by the user in response to INPUT should not be quoted (if quotes are typed,
they will become part of the string).
If an INPUT statement requires several consecutive numeric data items to be given by the ures, it is
possible to put them all on one line, as long as they are separated from one another by commas. For
example, a proper response to an INPUT statement which asks for three numbers is:
123, 456, 789 <CR>
However, since carriage-returns must terminate the INPUT of a string, the comma method is not
suitable for inputting several consecutive strings. To INPUT more than one string value on one line
of the terminal, successive INPUT1 statements must be used (see statement: INPUT1).
To illustrate proper user response to an INPUT statement, assume that example line 10 is executed.
A question mark (?) will appear on the terminal, this indicates that the computer is waiting for INPUT,
and the knowledgable user might type in the following:
2,3, WEASEL<CR>
(<CR>, of course, signifies strinking the homonymous key.) After <CR> is struck, A will be set to
2, B to 3, and Q$ to the string value “WEASEL”.
A single carriage return (representing no input) is acceptable when the next item in the variable list
is a string, in this case, the string will be set null. However, valid numeric input must be supplied for
numeric items in a variable list, an INPUT ERROR will occur if this isn’t done.
Note that the line editor may be used to modify the user’s input line before <CR> is struck.
When too few data items are typed before <CR> is struck, BASIC will type a double question mark
NSB8
Rel. 5.10
Page 39