
INP
INP(<port number>)
PRINT INP(&FF77)
FUNCTION : A function that returns the input value from the I/O port specified in the address.
Associated keywords:
OUT, WAIT
INPUT
INPUT [#<stre a m e x p r e s s i o n > ] [ ; ] [ < q u o t e d s t r i n g > ; ] < l i s t o f :
[variable]>
or INPUT [ # < s t r e a m e x p r e s s i o n > ] [ ; ] [ < q u o t e d s t r i n g > , ] < l i s t o f :
[variable]>
1 0 CLS
2 0 I N P U T “ G i v e m e t w o n u m b e r s , s e p a r a t e d b y
a comma ";A,B
3 0 I F A = B T H E N P R I N T " T h e t w o n u m b e r s
are the same"
4 0 I F A > B T H E N P R I N T A " i s g r e a t e r t h a n " B
5 0 I F A < B T H E N P R I N T A " i s l e s s t h a n " B
6 0 C L E A R : G O T O 20
COMMAND: Reads data from the stated stream. A semicolon after
IN PUT
suppresses the carriage
return typed at the end of the line being entered. A semicolon after the <quoted string> causes a
question mark to be displayed. A comma suppresses the question mark. If an entry is made that is of
the wrong type (eg a letter O was typed instead of a 0 in a numeric expression, then BASIC will
prompt with:
?Redo from start
..and the original prompt text that you entered.
All responses must be terminated with an
[ENTER].
The semicolon immediately after the <stream
expression> has the effect of suppressing the carriage return typed at the end of the line being
entered, leaving the cursor at the end of the text just entered. Where a cassette stream is indicated,
no prompt is generated, If one is specified, it will be ignored by the cassette software, so the same
program may read from either stream.
One item will be read from the stream for each variable in the list given. It must be compatible with
the type specified in the
IN PUT
command, which is: a numeric variable, terminated either by
comma, carriage return, white space or end of file.
Commas or
[ENTER]s
sent after trailing space will be ignored. Quoted strings will he read verbatim
until terminated by double quotes, subsequent entries are ignored as for numeric values. Unquoted
string items are terminated as in the case of numeric values.
Associatedkeywords:
LINE INPUT, READ, INKEY$
Summary of Contents for CPC464
Page 1: ......
Page 102: ...PRINT 10 AND 12 Results in 8 PRINT 10 AND 1000 Results in 8 again ...
Page 118: ...TO DO DRAW THIS PAGE ...
Page 219: ...actual value may be made to vary during the execution of a program ...
Page 240: ...Text and WINDOW planner Mode 2 80 Columns ...
Page 241: ......