EasyManuals Logo

Sinclair QL Beginner's Guide

Sinclair QL
135 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #23 background imageLoading...
Page #23 background image
CHAPTER 4 CHARACTERS AND STRINGS
Teachers sometimes wish to assess the reading ability needed for particular books or classroom
materials. Various tests are used and some of these compute the average lengths of words and
sentences. We will introduce ideas about handling words or character strings by examining simple
approaches to finding average word lengths.
We are talking about sequences of letters, digits or other symbols which may or may not be words.
That is why the term 'character string' has been invented. It is usually abbreviated to string. Strings
are handled in ways similar to number handling but, of course, we do not do the same operations on
them. We do not multiply or subtract strings. We join them, separate them, search them and generally
manipulate them as we need.
NAMES AND PIGEON HOLES FOR STRINGS
You can create pigeon holes for strings. You can put character strings into pigeon holes and use the
information just as you do with numbers. If you intend to store (not all at once) words such as:
FIRST SECOND THIRD
and
JANUARY FEBRUARY MARCH
you may choose to name two pigeon holes:
weekday$
month$
Notice the dollar sign. Pigeon holes for strings are internally different from those for numbers and
SuperBASIC needs to know which is which. All names of string pigeon holes must end with $.
Otherwise the rules for choosing names are the same as the rules for the names of numeric pigeon
holes.
You may pronounce:
weekday$ as weekdaydollar
month$ as monthdollar
The LET statement works in the same way as for numbers. If you type:
LET weekday$ = "FIRST"
an internal pigeon hole, named weekday$ will be set up with the value FIRST in it thus:
weekday$
FIRST
The quote marks are not stored. They are used in the LET statement to make it absolutely clear what
is to be stored in the pigeon hole. You can check by typing:
PRINT weekday$
and the screen should display what is in the pigeon hole:
FIRST
You can use a pair of apostrophes instead of a pair of quote marks.

Other manuals for Sinclair QL

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair QL and is the answer not in the manual?

Sinclair QL Specifications

General IconGeneral
ProcessorMotorola 68008
Clock Speed7.5 MHz
RAM128 KB (expandable to 640 KB)
ROM48 KB
Operating SystemSinclair QDOS
Release Year1984
StorageMicrodrive tape loop
Graphics256x256 pixels, 8 colors
PortsRS-232, ROM cartridge
SoundBeeper (internal speaker)

Related product manuals