EasyManua.ls Logo

AMSTRAD CPC464 - Input

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...
Type in
cls [ENTER]
to clear the screen.
To see the word hello printed continuously on each line, one next to another filling the whole of the
screen, type in the previous program but with a semi-colon ; after the quotation marks
Type:
10 print “hello”;
20 goto 10 [ENTER]
run [ENTER]
Note that the semicolon immediately following the [ENTER] tells the computer to print the next
character immediately following the previous one. Escape from this program by pressing [ESC]
twice. Now type in line 10 again, but this time use a comma , instead of a semi-colon ;
10 print “hello”, [ENTER]
run [ENTER]
You will now see that the comma , tells the computer to print the next character (or group of
characters) 13 columns away from the beginning of the first group of characters. This feature is
useful for displaying information in separate columns.
Note, however, that if the number of characters in a group exceeds 12, the next character will be
displaced forward by another 13 columns.
Again, to escape from this program press [ESC] twice. To clear the computers memory completely,
hold down the [SHlFT] [CTRL] 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 “what is your age”; age [ENTER]
20 print “you look younger than”; age “years
old.” [ENTER]
run [ENTER]
On the screen you will see:
what is your age?
Type in your age then [ENTER] If your age was 18, the screen would then show: you Look
younger than 18 years old.
This example shows the use of the input command and a number variable. The word age was put
into the memory at the end of line 10 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 age variable, we could have just as easily
used a letter, for example b.

Table of Contents

Other manuals for AMSTRAD CPC464

Related product manuals