EasyManua.ls Logo

AMSTRAD CPC464 - Page 150

AMSTRAD CPC464
249 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 [#<stream expression>][;][<quoted string>;]<list of:
[variable]>
or INPUT [#<stream expression>][;][<quoted string>,]<list of:
[variable]>
10 CLS
20 INPUT “Give me two numbers, separated by
a comma ";A,B
30 IF A=B THEN PRINT "The two numbers
are the same"
40 IF A>B THEN PRINT A "is greater than" B
50 IF A<B THEN PRINT A "is less than" B
60 CLEAR:GOTO 20
COMMAND: Reads data from the stated stream. A semicolon after INPUT 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 INPUT 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$

Table of Contents

Other manuals for AMSTRAD CPC464

Related product manuals