Input - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

(
Escape from this program by pressing [ESC] twice. Now type in line 10 again, but
this time, use a comma, instead of a semicolon;
1 0 pr i n t "h eLL 0",
[RETURN]
run
[RETURN]
You will now see that the comma , has told the computer to print the next group of
characters 13 columns away from the first group of characters. This feature is useful
for displaying information in
separat~
columns. Note however, that if the number of
characters in a group exceeds 12, the next group of characters will be displaced
forwards by another 13 columns, so as to always maintain a space between columns.
This figure of 13 columns is adjustable by use of the Z 0 N E command, described later
in this manual.
Again, to escape from this program, press [ESC] twice. To clear the computer's
memory completely, 'hold down the [CONTROL] [SHIFT] and [ESC] keys in that
order, and the computer will reset.
INPUT
This command is used to let the computer know that it is expecting something to be
typed in, for example, the answer to a question.
Type the following:
10 input "how oLd are you";age
[RETURN]
20 print "you Look younger than";age;
" yea r soL d ."
[RETURN]
r-un-[RETURN]- -' -------------- --------- -------- --------
On the screen you will see:
what is your age?
Type in your age then [RETURN]. If your age was 18, the screen would then show:
you Look younger than 18 years oLd.
This example shows the use of the; n put command and a number variable. The
word age was put into the memory at the end ofline 1 0 so that the computer would
associate the word age with whatever numbers were typed in and would print these
numbers where the word age is on line 20. Although we used the expression age in
the above for the variable, we could have just as easily used a letter, for example b.
Foundation Course
Chapter 1 Page 25

Advertisement

Table of Contents
loading

Table of Contents

Save PDF