Download Print this page

Commodore 64 User Manual page 47

Hide thumbs Also See for COMMODORE 64:

Advertisement

*■%
S,£, AND °/o KEYS
The S and £ signs are used to tell what kind
of money units are involved when you
have a series of numbers. The dollar sign and
the percent sign have additional uses as well.
$/4 KEY
One of the special uses of the dollar sign is to
indicate a character string. You have already
learned that character strings, also known as
string constants, are always enclosed within
quotation marks and do not change their
value or location within these marks. When
numbers are included within quotation marks
as characters, rather than as numeric values,
you can use the dollar sign to indicate this. For
example, if you wanted A to have the value of
ABC 123, you would type the following:
AS = "ABC 123" (Do not type this now; this is
only an illustration.)
This is known as identifying a string variable.
If you have a disk drive, you can use the dollar
sign to display a list of all the programs stored
on a specific diskette. Here is an example of
this application [do not type this example,
either): LOAD "S",8
If you are using numbers in an equation, do
not use the dollar sign, as the computer can
not recognize this character as a number. If
you do use the dollar sign in an equation, you
will get an error message.
You make the dollar sign appear by holding
the SHIFT key while pressing the number 4
key. Practice using the dollar sign in a char
acter string now by typing the following:
?"HAMBURGERS COST $2 "
Now press RETURN. The computer prints:
HAMBURGERS COST $2.
SCREEN 1
Do not clear the screen and do not turn off
the computer before going on to the next
exercise.
SCREEN 1
When used In a character string, the dollar
sign Indicates a money amount.
-; mj m dm* m * *****««»»
■ m m. «r c m * ~m ~m * at m hi » mm**
«r tram e«f.T^++ + ^t *m sp *&
~
DOLLAR SIGN/4 key
n
45

Advertisement

loading

Related Products for Commodore COMMODORE 64

This manual is also suitable for:

Vic 20