AMSTRAD CPC464 User Manual page 150

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

INP
I N P ( < p o r t n u m b e r > )
P R I N T I N P ( & F F 7 7 )
FUNCTION : A function that returns the input value from the I/O port specified in the address.
Associated keywords: O U T , W A I T
INPUT
INPU T
[# <str e a m
[ v a r i a b l e ] >
or
INPUT
[ # < s t r e a m
[ v a r i a b l e ] >
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 c o m m a " ; 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
a r e t h e s a m e"
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:
? R e d o f r om 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: L I N E I N PU T , R E A D , I N K E Y $
e x p r e s s i o n > ] [ ; ] [ < q u o t e d
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
s t r i n g > , ] < l i s t
o f :
o f :

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents