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 #46 background imageLoading...
Page #46 background image
CHAPTER 8 FROM BASIC TO SUPERBASIC
If you are familiar with one of the earlier versions of BASIC you may find it possible to omit the first
seven chapters and use this chapter instead as a bridge between what you know already and the
remaining chapters. If you do this and still find areas of difficulty. it may be helpful to backtrack a little
into some of the earlier chapters.
If you have worked through the earlier chapters this one should be easy reading. You may find that,
as well as introducing some new ideas, it gives an interesting slant on the way BASIC is developing.
Apart from its program structuring facilities SuperBASIC also pushes forward the frontiers of good
screen presentation, editing, operating facilities and graphics. In short it is a combination of user-
friendliness and computing power which has not existed before.
So, when you make the transition from BASIC to SuperBASIC you are moving not only to a more
powerful, more helpful language, you are also moving into a remarkably advanced computing
environment.
We will now discuss some of the main features of SuperBASIC and some of the features which
distinguish it from other BASICs.
ALPHABETIC COMPARISONS
The usual simple arithmetic comparisons are possible. You can write:
LET pet1$ = "CAT"
LET pet2$ = "DOG"
IF pet1$ < pet2$ THEN PRINT "Meow"
The output will be Meow because in this context the symbol < means:
earlier (nearer to A in the alphabet)
SuperBASIC makes comparisons sensible. For example you would expect:
'cat' to come before 'DOG'
and
'ERD98L' to come before 'ERD746L'
A simplistic approach, blindly using internal character coding, would give the 'wrong' result in both the
above cases but try the following program which finds the 'earliest' of two character strings.
100 INPUT item1$, item2$
110 IF item1$ < item2$ THEN PRINT item1$
120 IF item1$ = item2$ THEN PRINT "Equal"
130 IF item1$ > item2$ THEN PRINT item2$
INPUT
OUTPUT
cat
dog
cat
cat
DOG
cat
ERD98L
ERD746L
ERD98L
ABC
abc
ABC
The Concept Reference Guide section will give full details about the way comparisons of strings are
made in SuperBASIC.
VARIABLES AND NAMES - IDENTIFIERS

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