An integer variable always ends in a percentage sign, as shown in the program

below:

10 PRINT "Type any number " ;

20 INPUT whole%

30 PRINT "You typed ";whole%

RUN the program and input, say 4.5. The result shows why you must not use

an integer variable unless you are certain that the value stored there will

always be a whole number.

The variables A% to Z% are known as the resident integer variables and

memory space is automatically given to these variables when the computer is

switched on, so no extra memory is taken up if they are used in a program.

The computer loses the values of other variables after a program is run, but the

values of A% to Z% remain unchanged, even after typing NEW or pressing

BREAK. They provide a means of passing information from program to program.

There is one other special resident integer variable, @%. The value of @% is

used to control the way the computer prints numbers. @% is described in more

detail on page C24.

String variables

The variables described so far are numeric variables -- they can be used only to

store numbers. The computer can also store strings of characters (te. words

and phrases) in what are called string variables. A string variable always

ends in a dollar sign, as you can see in these examples:

Type_of_car$="Mini Metro"

CURRENCY$=" Francs"

Weather$="Wet "

The characters within the inverted commas are called strings. Type in and run

this brief program:

10 PRINT "What is your name " ;

20 INPUT name$

30 PRINT "Pleased to meet you ";name$

The string variable name$ in line 20 is used to store any name typed in. The

contents of name$ are printed out by line 30. A string variable can hold from

zero to 255 characters. You can prove this for yourself by running the program

a few times and inputting names of different lengths.

Any set of characters can be stored in a string variable, for example:

a_mixed_string$=" 123% . abc'@*"

C 6